Skip to content
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

Webpack 2.3.1 does not compile, misconfigured output path #88

Closed
AxolotlxWando opened this issue Mar 24, 2017 · 3 comments
Closed

Webpack 2.3.1 does not compile, misconfigured output path #88

AxolotlxWando opened this issue Mar 24, 2017 · 3 comments

Comments

@AxolotlxWando
Copy link

Hey there,
First notice the issue itself as dev build does not compile. Which is not too complicated to resolve at all. I assume that it is simply due to new validations added to webpack 2.3.1 to ensure output.path to be a absolute path, see error messages below.

Using Webpack DLL vendor bundle
webpack-for-backend Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "build/server" is not an absolute path! WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "build/server" is not an absolute path!

Upon further investigation though, when I try putting together a small fix I noticed git is staging new files, server code bundles, under tools directory (will include client bundles too if in prod mode). This is probably due to somewhere in point the build scripts and config are moved from project root to tools folder causing the context to be wrong.
This looks like misconfiguration, probably the reason why webpack 2 now reinforce the use of absolute path for output.path now too. It makes the context of the project structure much easier to reason about.

@AxolotlxWando
Copy link
Author

I've prepared a small patch that use path.resolve(__dirname, '..', backend/ frontendBuildDir) for all output paths...
But there is still problems. I cannot explain why the build been working so far and why bundles had been generated under both places BOTH /tools/build and /build so this imply something maybe a manual hack/ copy?

@larixer
Copy link
Member

larixer commented Mar 24, 2017

@ChingxWando Please wait for 2 mins, I will take a look

@larixer
Copy link
Member

larixer commented Mar 24, 2017

@ChingxWando
Please check, if the fix in the commit above works for you

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

No branches or pull requests

2 participants