Mimosa - Change name of minified asset at compiled dir

65 Views Asked by At

I've found Mimosa past month but now I am finally starting to use it.

Consider this configuration snippet:

exports.config = {
  "modules": [
    "copy",
    "minify-js"
  ],
  "watch": {
    "sourceDir": "src",
    "compiledDir": "dist",
    "javascriptDir": null
  }
}

The JavaScript assets from src are minified and saved at dist with the exact same name: src/foo.js is minified as dist/foo.js.

I would like to have both the minified file as .min.js and also the original unchanged and copied file at the compiled dir.

For example: src/bar.js becomes dist/bar.min.js (minified) and dist/bar.js (copy).

Is this possible? How?

1

There are 1 best solutions below

0
On

So that isn't something mimosa, or more specifically mimosa-minify-js will do.

What is your use case? Are you building libraries? I can either help you get what you need or I could see what I'd need to do to support what you want.