neutrinojs / neutrino

Create and build modern JavaScript projects with zero initial configuration.
https://neutrinojs.org
Mozilla Public License 2.0
3.94k stars 213 forks source link

Setting options.output to relative directory above project directory causes clean middleware to not work #362

Closed eliperelman closed 5 years ago

eliperelman commented 7 years ago

If you override the output directory like so:

module.exports = {
  options: {
    output: '../build'
  },
  use: ['neutrino-preset-react']
};

The clean middleware/plugin no longer works.

eliperelman commented 7 years ago

The fix for this is to pass the allowExternal: true option to the clean middleware. We do not want to do this by default as it poses a risk to the user for accidentally deleting unintended directories.

Instead, the fix for this issue will involve adding a new section to the clean middleware docs outlining how to use the option to remove directories outside of the project directory using this option.

Aditi574 commented 6 years ago

Hi! I would like to work on this.

eliperelman commented 6 years ago

@Aditi574 feel free! As mentioned in my previous comment this would be a documentation change in the docs directory as well as the README in the clean package:

Instead, the fix for this issue will involve adding a new section to the clean middleware docs outlining how to use the option to remove directories outside of the project directory using this option.

Aditi574 commented 6 years ago

@eliperelman please review my PR #723. Thanks!