-
Notifications
You must be signed in to change notification settings - Fork 213
Remove default CopyPlugin from src/static/ to build/static/ #814
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
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.
But |
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 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 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. |
Makes sense |
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 |
) - 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)
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.