Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

clean middleware options are not passed to the webpack plugin #502

Closed
zeropaper opened this issue Dec 1, 2017 · 4 comments
Closed

clean middleware options are not passed to the webpack plugin #502

zeropaper opened this issue Dec 1, 2017 · 4 comments

Comments

@zeropaper
Copy link
Contributor

What version of Neutrino are you using?
7.3.3

Are you trying to use any presets? If so, which ones, and what versions?
neutrino-preset-react (but I believe the problem lies in the neutrino-preset-web)

Are you using the Yarn client or the npm client? What version?
npm 5.5.1

What version of Node.js are you using?
8.3.0

What operating system are you using?
Kubuntu

I was struggling a bit to tweak the "clean" setup (in the neutrino-preset-react) when I discovered that my options were not passed to the clean-webpack-plugin has I would have expected.

if my .neutrinorc.js I have something like:

[
      'neutrino-preset-react',
      {
        html: {
          // ...
        },

        babel: {
          //...
        },

        clean: {
          exclude: ['.git']
        }
      }
    ],

After digging a bit I found the possible issue here:
https://github.com/mozilla-neutrino/neutrino-dev/blob/6c7e840fb79cd612a64cae66c27acd132fc3e5f9/packages/web/index.js#L189

I could actually get around my problem by using the following script (don't know if it is really elegant though)

(neutrino) => {
      const { config } = neutrino;

      config.plugins.delete('clean');
      config.plugin('clean')
        .use(CleanPlugin, [[neutrino.options.output], {
          exclude: ['.git']
        }]);
// ...

I've tried to fix this and send a PR but I now have issues about packages not being found (probably related to the '@neutrino/...' (i tried to "npm link" the package in order to try the changes)

@eliperelman eliperelman added the bug label Dec 1, 2017
@eliperelman
Copy link
Member

@zeropaper right now the master branch is for the next release, v8. If you want to patch v7, you can base a new branch off of the release/v7 branch. You can also submit a PR to master for the packages/clean package and we can backport it to release/v7. Let me know which approach you'd like to take and I'll coach you through it!

@zeropaper
Copy link
Contributor Author

zeropaper commented Dec 2, 2017 via email

@zeropaper
Copy link
Contributor Author

Looks to me like it's fixed, I'll close the issue.

@eliperelman
Copy link
Member

Thanks again! I have released this in v7.4.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants