webpack-build
webpack-build copied to clipboard
webpack-build errors
- Currently, it seems as if the data.stats object passed to the
build
callback contains outdated information between invocations of the script runningwebpack-build
.
data.stats.time reports the original build time +- a few ms, not the cached build time of bundles. for example, when i start the build process up for a bundle that's already been built, data.stats.time states that the bundle has been built in ~20 sec even though the script only took 1-2 sec to start up and no building has taken place.
- also, something else I've noticed is that the 2
require
calls (src/wrappers/Wrapper.js: L45, src/utils/check_config_file.js: L27) don't work correctly because they interpret the argument as relative pathing to the paths of the files that the calls are placed in. How were you able to deal with this during testing?
Let me know if you need a helping hand on this module! I'd be happy to help.
-
Yeah, that's unfortunately odd behaviour, but also by design. The persistent caching only operates at an extremely high level, so it just stores the entire stats object and serves it up. I'm hesitant to monkey patch webpack's numbers, but maybe we could add our own timestamps.
-
I think that's probably a reflection of node's resolve algorithm, where all paths are relative to the file that calls
require
, unless the path is absolute, in which case it resolves as expected. The original use case for webpack-build only called for absolute paths, hence lower levels that assume the paths will resolve correctly. You should be able to callrequire.resolve('./path/to/configfile.js')
to pass in an absolute path.
Ah ok, the workaround with require.resolve is nice. Thanks!