-
Notifications
You must be signed in to change notification settings - Fork 56
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
Ensure output path exists and write all handled files #2
Comments
I will happily accept a PR.
|
@chrisblossom, @majodev, @sretlawd please see if v2 solves the problem. |
@gajus I am actually not using the webpack-dev-server package. Can this devServer.outputPath change be optional? Also, the option to only write specific extensions, specifically only .css, was removed from this PR which was in mine. Would you accept a pull request with this functionality built on 2.0? EDIT: FYI, I am using https://github.com/erikras/react-redux-universal-hot-example for a boilerplate. |
Does this not have the issue described here? #1 |
Please open a new issue. The reason it was "removed" is because it has not been discussed as a separate issue. |
#1 does not appear to be an issue when not using webpack-dev-server. console.log(compiler.options.output);
{ path: '/Users/chris/github/website/static/dist',
filename: '[name]-[hash].js',
chunkFilename: '[name]-[chunkhash].js',
publicPath: 'http://localhost:3001/dist/',
libraryTarget: 'var',
sourceMapFilename: '[file].map[query]',
hotUpdateChunkFilename: '[id].[hash].hot-update.js',
hotUpdateMainFilename: '[hash].hot-update.json',
crossOriginLoading: false,
hashFunction: 'md5',
hashDigest: 'hex',
hashDigestLength: 20,
sourcePrefix: '\t',
devtoolLineToLine: false } |
I think that having Therefore, unless someone gives a good reason not to, I will be keeping the The ideal solution would be contributing a fix to the https://github.com/webpack/webpack-dev-server. |
When adding "devServer: {outputPath: assetsPath}, " to my config I am getting the following error:
console.log(outputPath);
[0] /Users/chris/github/website/static/dist |
What is the name of |
Does the issue persist if you replace bundleFilePath = path.join('/', bundleFileName); with bundleFilePath = path.join(outputPath, bundleFileName); ? |
I have just pushed version 2.1.1 that implements the earlier suggestion. |
Just a thought to make it less opinionated/remove devServer requirement: 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." |
Confirmed that 2.1.1 4d2a3e5 fixed the error I was getting. |
Thank you |
Please copy-paste you have written and open a separate issue. |
Hi,
Your plugin currently throws if the specified output directory was not created before (or cleaned via another plugin at the start) and does not handle assets that were not part of a chunk. I think @sretlawd fixes this quite nicely in his fork, you might wanna take a look at it and merge back...
see: https://github.com/sretlawd/write-file-webpack-plugin/commit/0ccdacdc0612f0f362c151cef88685292ee81093
Anyways, Thank you for this plugin. 👍
The text was updated successfully, but these errors were encountered: