-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Add DLL support to CRA #2710
Add DLL support to CRA #2710
Conversation
This is very cool stuff. However, I think we can't take it until it gets more real world usage. Do you mind working with webpack folks to find good first projects to try it? Perhaps in some webpack issue where people complain about build times. Once bugs are squashed and limitations are known we can come back to this. |
Hi @gaearon! Also, your tweet brought a lot of traffic to the Repo (thanks by the way!), and a couple of issues and PRs started to pile up. Most of them related to using DLL in production which is an interesting use case, I only thought about it as a development tool till now, but it makes sense. |
Another thing I don't understand is invalidation. How do you handle that? For example if I want to edit something in |
Great question. I use find-cache-dir to create the cache dir inside node_moduels
I also store the plugins settings as |
Right, but I mean the case where somebody might put |
I've googled a bit maybe we can use this node equivalent bash command
To hash the contents of node_modules source Another thing is that the DLL compiler should run in watch mode to catch the changed files and rebuild accordingly |
(sorry if my comments are distracting, but I really excited to see how this feature landed :D) |
Does Yarn delete the .cache directory? I think we've seen instances where it doesn't, just something to be mindful of -- but yes node modules may be edited manually. |
@viankakrisna, not at all! you are most welcome.
@gaearon in that case, yes, it will not invalidate.
I agree that adding 'watch' functionally is a feature worth adding, but I think it should not be enabled by default. I fear that watching the entire node_moduels can have an impact on performance.
@Timer, interesting, I tested it with both Yarn & NPM, can you remember a case where it doesn't? |
@asfktz yeah, a node version of I've been checking out npm packages for hashing a directory, but haven't tested the performance yet. https://github.com/mcavage/node-dirsum and https://github.com/marc136/node-folder-hash is some of it. |
Hmm.. interesting! |
Hmm, it wouldn't work if we are editing a transitive dependency. But interesting to have it as an option :) As for the case with |
@viankakrisna would you like to join the to the discussion on asfktz/autodll-webpack-plugin#7? |
Note: plugins from webpack will not apply to the AutoDllPlugin unless you provide them explicitly. For example: // webpack.config.dev.js
module.exports = {
plugins: [
new webpack.NamedModulesPlugin(),
new AutoDllPlugin({
plugins: [
new webpack.NamedModulesPlugin(), // won't apply unless you put this line
],
}).
],
}; |
@@ -42,6 +42,8 @@ | |||
"extract-text-webpack-plugin": "2.1.2", | |||
"file-loader": "0.11.2", | |||
"fs-extra": "3.0.1", | |||
"html-webpack-plugin": "2.28.0", |
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.
Already has html-webpack-plugin 2.29.0. Can remove this
@@ -42,6 +42,8 @@ | |||
"extract-text-webpack-plugin": "2.1.2", | |||
"file-loader": "0.11.2", | |||
"fs-extra": "3.0.1", | |||
"html-webpack-plugin": "2.28.0", | |||
"jest": "20.0.3", |
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.
"jest": "20.0.4"
is already in packages.json. Should remove this line "jest": "20.0.3"
Webpack 4 has better capabilities than dll. It will be in cra soon. |
@andriijas What's the eta of webpack 4 to be in cra? |
See: #48 (comment)