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

The library preset enables all types of minification by default #807

Closed
edmorley opened this issue Apr 19, 2018 · 0 comments · Fixed by #815
Closed

The library preset enables all types of minification by default #807

edmorley opened this issue Apr 19, 2018 · 0 comments · Fixed by #815
Assignees

Comments

@edmorley
Copy link
Member

edmorley commented Apr 19, 2018

The library preset .use()s the minify preset without passing any options, which activates all of {babel-minify, style-minify, image-minify}:
https://github.com/mozilla-neutrino/neutrino-dev/blob/ce7139784507f788ad8509ef5cbc0ad30da34f36/packages/library/index.js#L150

Compare this to the web preset:
https://github.com/mozilla-neutrino/neutrino-dev/blob/ce7139784507f788ad8509ef5cbc0ad30da34f36/packages/web/index.js#L213

Issues:

  1. I'm not sure all types of minification be enabled by default. Thoughts?
  2. We should allow people to adjust the options, like we do for the web preset.

Filing this since it affects the current implementation of the webpack-4 branch, since that uses (at least for now, to let us A/B test) a toggle to switch between uglify-es and babel-minify.

edmorley added a commit that referenced this issue Apr 24, 2018
* Removes the web preset's dependency on `@neutrinojs/image-minify`
  since it has many heavyweight native code dependencies, and isn't
  enabled by default anyway (see #713).
* Removes the library preset's dependency on `@neutrinojs/style-minify`
  and `@neutrinojs/image-minify` (fixes #807).
* Removes the `@neutrinojs/minify` preset in favour of directly
  depending on the individual `@neutrinojs/*-minify` presets.
* Adds an `enabled` option to `@neutrinojs/image-minify` that defaults
  to production only, to allow for string form usage of the preset in
  `.neutrinorc.js`, without the need to specify a `.when()`.
@edmorley edmorley self-assigned this Apr 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

1 participant