2

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

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.