clean-webpack-plugin: Error: "project root is outside of project"
Hi,
Due to various reasons in our project, the client builds into the ‘public’ folder of our rails app. For illustration purposes:
server/client- client dir (wherewebpack.config.jslives), and where the build is run fromserver/public- webpackconfig.output.pathdir, where webpack builds relative to
It looks like this plugin relies on workingDir (i.e. process.cwd()) over webpack’s config.output.path.
Would it be ok to change this? Webpack is building happily into a folder that isn’t the cwd.
What I’m looking for is to remove / clean the files pre-build, in:
server/public/scriptsandserver/public/styles- leave anything else in
server/publicintact
Thanks!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (13 by maintainers)
@alextreppass You do not need to change anything.
process.cwd()is the safe default for therootoption.Where
projectRootDiris set: https://github.com/johnagan/clean-webpack-plugin/blob/master/index.js#L41Does not for work projects with multiple workspaces, where there is some webpack.config.base.js injecting clean-webpack-plugin in it located in another folder outside the subpackage. E.g.: =packages ==shared ===webpack.config.base.js ==subpackage1 ===webpack.config.js