Feat/filename transform#321
Conversation
|
What is use case? Why it is need if you have |
Exporting your CSS to a different subfolder based on the chunk. |
pgoforth
left a comment
There was a problem hiding this comment.
Can't wait for this PR as the other one was stale
@evilebottnawi ...it is easy to get the ...also, not desirable. |
|
We need this functionality as well. |
I tried this way but was unable to generate the files into their separate directories. |
|
Can someone have a look at why |
|
Can I help in anyway to get this pushed faster? I need this functionality badly. |
|
Need rebase and fix CI problem |
add example to README.md
ceb72c8 to
3a03fc4
Compare
|
@kevinchappell need fix CI problem |
update readme to reflect webpack's output.filename
use DEFAULT_FILENAME for options.chunkFilename when options.filename is a function
chunkFilename should handle string and function options.filename
|
I'm not familiar with webpack plugin development. If I can get pushed in the right direction to learn so this can get pushed would be great. This is a major need. |
|
Are anymore changes needed on this? |
This PR contains a:
Motivation / Use-Case
The
filenameoption currently takes a string the enables devs to customize the filename of the generated css file. This works well and the customized filename is created in the same output directory as the js file it is extracted from, however there are cases when the generated files may need to be in different directories. This change enables modifying thefilenameTemplateby providingchunkhash,contenthash,name, andidas arguments when a function is used for thefilenameoption instead of a string.Use Case:
webpack.config.js -
entryThe above config will create
dist/main.jsanddemo/assets/js/demo.js.Use:
webpack.config.js -
pluginsWe can change the output directory, chunkhash length and more by using a function that gets called during
compilation.mainTemplate.hooks.renderManifest.Breaking Changes
Most likely none
Additional Info
Improved some existing tests. Now testing filename and path generation.