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

fix(webpack-plugin): create output folder with mkdirp #273

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

jackhsu978
Copy link
Contributor

Summary

If neither outputFolder nor the directory of outputFolder exist, then outputFolder would not be available for write. For example, if outputFolder is /a/b/c, but /a/b does not exist, then the plugin cannot create directory /a/b/c and cannot write any files to it.

Test plan

I tested the razzle example in the repo with the following steps:

  1. in examples/razzle/razzle.config.js, change const filename = path.resolve(__dirname, 'build') to const filename = path.resolve(__dirname, 'build/a/b/c')
  2. run yarn start and observe that it results in an error Error: ENOENT: no such file or directory, mkdir ...
  3. use the patched plugin and try yarn start again, observe that there is no error this time, the folder build/a/b/c is created, and loadable-stats.json is written to build/a/b/c

@gregberge gregberge merged commit 3767f28 into gregberge:master Mar 19, 2019
@gregberge
Copy link
Owner

It makes sense, thanks!

@jackhsu978 jackhsu978 deleted the mkdirp branch March 20, 2019 00:48
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

Successfully merging this pull request may close these issues.

2 participants