Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

webpack-build errors #11

Open
donasaur opened this issue Dec 24, 2015 · 2 comments
Open

webpack-build errors #11

donasaur opened this issue Dec 24, 2015 · 2 comments

Comments

@donasaur
Copy link

  1. Currently, it seems as if the data.stats object passed to the build callback contains outdated information between invocations of the script running webpack-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.

  1. 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.

@markfinger
Copy link
Owner

  1. 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.

  2. 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 call require.resolve('./path/to/configfile.js') to pass in an absolute path.

@donasaur
Copy link
Author

Ah ok, the workaround with require.resolve is nice. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants