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

Premature public directory check for copying at af-webpack/lib/getConfig.js #61

Closed
tsuijie opened this issue Jan 23, 2018 · 3 comments
Closed

Comments

@tsuijie
Copy link

tsuijie commented Jan 23, 2018

af-webpack/lib/getConfig.js, line 185-191:
  if ((0, _fs.existsSync)((0, _path.resolve)(opts.cwd, 'public'))) {
    copyPlugins.push(new _copyWebpackPlugin.default([{
      from: (0, _path.resolve)(opts.cwd, 'public'),
      to: outputPath,
      toType: 'dir'
    }]));
  }

If public directory is set as the destination directory, webpack will remove the directory after fs.existsSync check, which will cause copy-webpack-plugin compile error.
Suggestion: either externalize this configuration, or disable this feature completely since the copy configuration for copy-webpack-plugin is already externalized.

sorrycc/roadhog#30
sorrycc/roadhog#341
sorrycc/roadhog#464

@sorrycc
Copy link
Member

sorrycc commented Jan 26, 2018

How to reproduce it?

@sorrycc sorrycc closed this as completed Jan 31, 2018
@sorrycc
Copy link
Member

sorrycc commented Jan 31, 2018

Feel free to reopen it have any progress.

@tsuijie
Copy link
Author

tsuijie commented Feb 1, 2018

Using roadhog configuration, at .webpackrc.js:

  "outputPath": "./public",
  "publicPath": "/",
  "copy": [
    {
      "from": path.resolve(__dirname + '/someDirectory'),
      "to": path.resolve(__dirname + '/public')
    }
  ],

Under the circumstances that the public directory has shared usage with other applications and cannot be completely removed by webpack scaffolding.

xierenyuan pushed a commit to xierenyuan/umi that referenced this issue Jun 23, 2022
* docs: dir rfc according to doc site routes

* docs: extract concepts to multiple single files
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

2 participants