Skip to content

Remove devServer.outputPath requirement #5

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

Closed
chrisblossom opened this issue Dec 7, 2015 · 7 comments
Closed

Remove devServer.outputPath requirement #5

chrisblossom opened this issue Dec 7, 2015 · 7 comments
Assignees

Comments

@chrisblossom
Copy link
Contributor

Just a thought to make it less opinionated/remove devServer requirement when not using webpack-dev-server:

if (!compiler.options.output.path) {
    throw new Error('output.path is not defined.');
}

if (compiler.options.devServer && (compiler.options.devServer.outputPath !== compiler.options.output.path)) {
    throw new Error('output.path and devServer.outputPath must be equal.');
}

outputPath = compiler.options.output.path;

Readme could say something along the lines of "If using webpack-dev-server, devServer.outputPath must equal output.path."

@gajus
Copy link
Owner

gajus commented Dec 8, 2015

First I will see if I can make webpack-dev-server change the behaviour on their end (webpack/webpack-dev-server#337). Will come back to this in about a week.

@gajus gajus self-assigned this Dec 8, 2015
@gajus gajus closed this as completed in f8abd09 Feb 10, 2016
@gajus
Copy link
Owner

gajus commented Feb 10, 2016

@chrisblossom v3.1.7 published.

@chrisblossom
Copy link
Contributor Author

@gajus thank you!

@wyntau
Copy link
Contributor

wyntau commented Feb 17, 2016

@gajus webpack-dev-server still overwrite output.path, so this plugin get error output.path when use compiler.options.output.path

And when I use this plugin in windows, all files are wrote to incorrect place

because path.sep in windows is \, so compiler.options.output.path is used incorrectly

@gajus
Copy link
Owner

gajus commented Feb 17, 2016

@gajus webpack-dev-server still overwrite output.path, so this plugin get error output.path when use compiler.options.output.path

Have you read the usage docs?

https://github.com/gajus/write-file-webpack-plugin#usage

@gajus
Copy link
Owner

gajus commented Feb 17, 2016

because path.sep in windows is , so compiler.options.output.path is used incorrectly

I am not familiar with windows. Can you submit a PR addressing the issue?

@wyntau
Copy link
Contributor

wyntau commented Feb 17, 2016

OK. I will make a PR to solve this problem.

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

No branches or pull requests

3 participants