-
-
Notifications
You must be signed in to change notification settings - Fork 384
Feat/filename transform #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
filename
option 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 thefilenameTemplate
by providingchunkhash
,contenthash
,name
, andid
as arguments when a function is used for thefilename
option instead of a string.Use Case:
webpack.config.js -
entry
The above config will create
dist/main.js
anddemo/assets/js/demo.js
.Use:
webpack.config.js -
plugins
We 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.