Comments (10)
@MoOx I finally figured out what your experiencing here. HardSource has a safety mechanism to invalidate modules when there cached dependencies are invalid. But HardSource doesn't yet understand dependencies that lead to DelegatedModules used by DllReferencePlugin. So when a cached module depends on a DelegatedModule its always being invalidated. The end result is Modules depending on a module in a DLL will be cached and in the next run invalidated, leading to a rebuild of that Module. Modules in the same run that don't depend on modules in the DLL will not be invalidated and will use the previously cached version.
Now I can finally fix this issue.
from hard-source-webpack-plugin.
Just to clarify is that the build time with DllPlugin
or DllReferencePlugin
?
Assuming DllPlugin
, I'm not immediately sure what would be limiting HardSource's impact.
Assuming DllReferencePlugin
, HardSource can't improve much for the modules delegated by the DllReferencePlugin. The ReferencePlugin uses DelegatedModule
s instead of the NormalModule
s that HardSource caches. If we added caching of DelegatedModules
s I don't think it'd change the amount of time spent much, DelegatedModule
is pretty light on work, they most likely do far less work than HardSource's HardModule. I'd wonder if the dependency to the module contained in the dll could be causing unnecessary rebuilds of the NormalModule
s. I'll look at that but I'm doubtful as it should be a normal CommonJsRequireDependency
(or HarmonyImportDependency
or AMDRequireDependency
).
Last thing I'm curious about is how you are using the dll source. Is it another script tag in your html or are you prepending it to your chunk during the webpack build? The latter could be adding time, enough to hide that HardSource is providing a benefit. If so I'd set noParse to excluding the dll from parsing. That would save a lot of time considering its probably a large file. After that there'd be a small amount additional time spent building the resulting chunk and emitting it. (Mostly building the chunk I'd guess.)
from hard-source-webpack-plugin.
Oh, so I looked at HardSource + Dll. Check your manifest. My manifest on the first build was correct, but the later build wasn't. I have fix inbound, its because a function on NormalModule wasn't exposed on HardModule that results in the dll building but the manifest being empty.
As this effects the dll build on the second run it'd cause the reference build to revert to using just HardModule's. If the reference build uses the first run of the dll build you should see the DllReferencePlugin taking proper effect.
from hard-source-webpack-plugin.
The issue I am facing is with DllReferencePlugin
. I am using it via script tag to avoid webpack again on this file.
Stuff generated by DllPlugin
seemed to look good.
from hard-source-webpack-plugin.
Will take a second look when I get some time.
from hard-source-webpack-plugin.
@MoOx have you been able to take a second look? I tested some myself and for DllReferencePlugin
it is working for me.
from hard-source-webpack-plugin.
With my last test it was "working" but perf were not improved at all (your plugin: 2s, your plugin + dllreference: 12s).
from hard-source-webpack-plugin.
@MoOx is there a branch of Phenomic I can checkout relating to this? I have a few working test repos with DllPlugin and DllReferencePlugin that experience a speed up with the Reference plugin and HardSource together. I haven't been able to reproduce a slow down with the two. Until then I'm not sure I can move this issue further.
from hard-source-webpack-plugin.
@MoOx lol wish I saw this thread. Just tried to implement this myself.
Was the conclusion that DLL won't work with hard source?
from hard-source-webpack-plugin.
Sorry I didn't take time to continue on this since I am pretty happy with the current state of this plugin. DLL plugins involve too much effort from the user configuration with a really small benefit at the end. Not sure I will try again on this. Will take a look if I still have my git stash somewhere :)
from hard-source-webpack-plugin.
Related Issues (20)
- Error: Can't find options with ident 'vue-loader-options' HOT 1
- Not emitting CSS background images from package
- A problem when work with eslint
- Static assets are not generated on second build HOT 1
- This is a very good product
- exclude directory from all cache
- hard-source-webpack-plugin on Apple Silicon with M1 compatibility? HOT 1
- TypeError: Cannot read property 'call' of undefined HOT 1
- Should not use entire package.json as a hash. Should only use packageJson.dependencies HOT 1
- can not run with hard-source with cache.
- Failed to read cache during the second build HOT 3
- If I modify only one variable, do I have to cache it again?
- Webpack 5.x not supportted, because `compiler.hooks` can not add property HOT 5
- building new cache every time HOT 4
- https://github.com/mzgoddard/hard-source-webpack-plugin/issues/461#issuecomment-439177290
- Could not freeze HOT 6
- TypeError: Cannot read properties of undefined (reading 'tap') HOT 15
- Q: Should the property be cache set to true or it doesn't depend
- switch different mode to build application but no effect HOT 1
- The application runs incorrectly at the second packaging HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hard-source-webpack-plugin.