Skip to content

Symfony Encore – minify using Terser #33

Open
@jremen

Description

Hello,
I'm trying to use this plugin with webpack encore. I can concate JS files with encore webpack config like this:

const MergeIntoSingleFilePlugin = require('webpack-merge-and-include-globally'); .addPlugin( new MergeIntoSingleFilePlugin({ files: {} })

But I'm not able to use transform function with Terser plugin like:
tranform: { 'myfile.js': code => new TerserPlugin({include: 'myfile.js.js'}).minify(code).code }

It seems like terser will not notify that my file exists at all or is running before concatenation is finished. File is concatenated just fine, but minification doesn't work.

Also, I'm aware that Terser is already part of Encore and I don't want to call it like that, but this is probably questions for encore developers.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions