I have updated my project from Angular 5.2 to Angular 6.0 following all steps as mentioned in the update guide. Now, when running npm start, I get the following error:
Error: Cannot find module '@angular/cli/plugins/webpack'
The line throwing the error is this import in the webpack.config.js
const { GlobCopyWebpackPlugin } = require('@angular/cli/plugins/webpack');
plugins.push(new GlobCopyWebpackPlugin({
"patterns": [
"assets",
"favicon.ico"
],
"globOptions": {
"cwd": process.cwd() + "/src",
"dot": true,
"ignore": "**/.gitkeep"
}
}));
The imported package no longer exists with CLI 1.6.
Also searching for it, I could not find a solution (update webpack config or replace GlobCopyWebpackPlugin with something else).
asked May 15, 2018 at 9:24
Matthias Sommer
1,08713 silver badges29 bronze badges
1 Answer 1
I went for this solution using the CopyWebpackPlugin instead
const CopyWebpackPlugin = require('copy-webpack-plugin');
plugins.push(new CopyWebpackPlugin([
{ from: process.cwd() + '/src/assets/**/*', to: process.cwd() + "/dist", ignore: ['*.gitkeep'] },
{ from: process.cwd() + '/src/favicon.ico', to: process.cwd() + "/dist" }
]));
answered May 15, 2018 at 9:50
Matthias Sommer
1,08713 silver badges29 bronze badges
Sign up to request clarification or add additional context in comments.