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

Remove default CopyPlugin from src/static/ to build/static/ #814

Merged
merged 1 commit into from Apr 23, 2018

Conversation

@edmorley
Copy link
Member

edmorley commented Apr 23, 2018

Since for most assets users should be importing in the build, and for the valid use-cases of not doing that (eg robots.txt), this default plugin didn't help anyway.

Another step forwards in making Neutrino default to fulfilling the 80% case, and then leaving the 20% to opt-in middleware, rather than having too much enabled by default.

@edmorley edmorley self-assigned this Apr 23, 2018
Copy link
Member

eliperelman left a comment

💯

Since for most assets users should be importing in the build, and
for the valid use-cases of not doing that (eg `robots.txt`), this
default plugin didn't help anyway.
@edmorley edmorley force-pushed the edmorley:rm-copy-static branch from 96c6c3d to c102ddb Apr 23, 2018
@edmorley edmorley merged commit 857df51 into neutrinojs:master Apr 23, 2018
2 checks passed
2 checks passed
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@edmorley edmorley deleted the edmorley:rm-copy-static branch Apr 23, 2018
@constgen

This comment has been minimized.

Copy link
Contributor

constgen commented Apr 26, 2018

But @neutrinojs/copy will stay in the core in case somebody will use it, will it?

@edmorley

This comment has been minimized.

Copy link
Member Author

edmorley commented Apr 26, 2018

It's still in the repo now, yes.

Though longer term I think we need to decide whether these micro presets are really worth it.

In the case of @neutrinojs/copy all it saves is:

const CopyPlugin = require('copy-webpack-plugin');
neutrino.config.plugin('copy').use(CopyPlugin, [patterns, options]);

...which isn't much more harder to understand than:

const copy = require('@neutrinojs/copy');
neutrino.use(copy, { patterns: [], options: {}});

The same applies to @neutrinojs/env now that webpack 4 sets NODE_ENV automatically, and so the preset no longer needs to include that entry itself.

All of these layers of abstraction make fully understanding what's going on harder than it need be IMO. One ends up having to learn {webpack, specific webpack plugin options, how neutrino wraps those plugins and passes the options on} - rather than just the first two.

@constgen

This comment has been minimized.

Copy link
Contributor

constgen commented May 4, 2018

Makes sense

@davidje13

This comment has been minimized.

Copy link

davidje13 commented Feb 24, 2019

For those poor saps like me experimenting with updating to v9, could you add the old configuration to the migration guide so that it's easy to maintain old behaviour? There are a lot of breaking changes and the more I can just patch with quick fixes the better.

From looking at the PR I believe the code is:

neutrino.use(copy, {
  patterns: [{
    context: 'src/static',
    from: '**/*',
    to: 'static',
  }],
});

Or equivalently:

['@neutrinojs/copy', {
  patterns: [{
    context: 'src/static',
    from: '**/*',
    to: 'static',
  }],
}],

(plus a new dependency on @neutrinojs/copy)

edmorley added a commit to edmorley/neutrino that referenced this pull request Mar 24, 2019
- Improve documentation based in feedback in neutrinojs#1129.
- Add checks for the legacy Neutrino `options.host` and `options.port`,
  since they were removed in neutrinojs#852.

Refs:
neutrinojs#1129 (comment)
neutrinojs#1129 (comment)
neutrinojs#814 (comment)
edmorley added a commit that referenced this pull request Mar 24, 2019
)

- Improve documentation based in feedback in #1129.
- Add checks for the legacy Neutrino `options.host` and `options.port`,
  since they were removed in #852.

Refs:
#1129 (comment)
#1129 (comment)
#814 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.