yeoman / grunt-usemin

[UNMAINTAINED] Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views)
BSD 2-Clause "Simplified" License
1.22k stars 338 forks source link

Have a way to specify different file names / conventions for concat, minify and revision. #432

Open ghost opened 10 years ago

ghost commented 10 years ago

My folder structure:

client/
|____index.html
|____login.html
|____dashboard/
|____|____dashboard.js
|____department/
|____|____department.js
|____public/
|____|____404.html
|____|____500.html
|____dist/
|____|____scripts/
|____|____|____app.12345.js

Ideally, I would like to deploy app.js (concatenation) to uat environment, app.min.js (minification) to staging environment and app.12345.js to live environment. And have source map generated and mapped to appropriate file names (app.js, app.js.map or app.min.js, app.min.js.map).

At the moment, I can not use the well established naming conventions. BUT ideally I would like to have something like below

concatenation -> app.js concatenation -> app.js.map minification -> app.min.js minification -> app.min.js.map revision -> app.min.12345.js

At the moment what I get, if only concatenation + minification (source_map is whatever the path value specified in useminPrepare:options:staging)

concatenation -> source_map/client/dist/scripts/app.js concatenation -> no source map minification -> client/dist/scripts/app.js minification -> client/dist/scripts/app.js.map

At the moment what I get, if concatenation + minification + revision

concatenation -> source_map/client/dist/scripts/app.js minification -> where's the minified js? gone! minification -> client/dist/scripts/app.js.map where does this even map to now? revision -> client/dist/scripts/app.12345.js

stephanebachelier commented 9 years ago

Can you sahre your configuration and which usemin version you use ?