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

bug: @angular/cli version 1.6.4 causes webpack build to fail #118

Closed
mo2menelzeiny opened this issue Jan 27, 2018 · 1 comment
Closed

bug: @angular/cli version 1.6.4 causes webpack build to fail #118

mo2menelzeiny opened this issue Jan 27, 2018 · 1 comment

Comments

@mo2menelzeiny
Copy link
Contributor

mo2menelzeiny commented Jan 27, 2018

@angular/cli 1.6.4 removed the InsertConcatAssetsWebpackPlugin, and added ScriptsWebpackPlugin
I tried to make it work however I haven't succeeded on re-implementing the external scripts feature.

plugins.push(new InsertConcatAssetsWebpackPlugin([
                 ^
TypeError: InsertConcatAssetsWebpackPlugin is not a constructor

UPDATE:

it's becasue the new cli version doesn't having this class, I just resolved this by replacing the InsertConcatAssetsWebpackPlugin with the new ScriptsWebpackPlugin.

const {BaseHrefWebpackPlugin, NamedLazyChunksWebpackPlugin, ScriptsWebpackPlugin} = require('@angular/cli/plugins/webpack');

now in the implementation replace

plugins.push(new InsertConcatAssetsWebpackPlugin([
      "scripts"
    ]));

with the new imported ScriptsWebpackPlugin implementation

plugins.push(new ScriptsWebpackPlugin({
      name: "scripts",
      sourceMap: true,
      scripts: scripts
    }));
@mo2menelzeiny mo2menelzeiny changed the title Build error due to new version of angular cli bug: @angular/cli version 1.6.4 causes webpack build to fail Jan 31, 2018
@firrae
Copy link

firrae commented Feb 7, 2018

I'm running 1.6.4 and had the same issue. After updating to ng-cli 1.6.7 though I'm now getting Error: Cannot find module '@ngtools/webpack' when I run npm start. Are these potentially connected issues?

EDIT: Scratch my issue. I had an environment variable messed up and yarn didn't install the dev dependencies as I expected.

maximegris added a commit that referenced this issue Feb 15, 2018
OzymandiasTheGreat pushed a commit to OzymandiasTheGreat/emoji-keyboard that referenced this issue Feb 15, 2020
smartdevcode added a commit to smartdevcode/angular-electron that referenced this issue Oct 13, 2021
mooncode610 added a commit to mooncode610/angular-electron that referenced this issue Oct 31, 2021
Hercules2013 added a commit to Hercules2013/angular-electron that referenced this issue Oct 24, 2023
Hercules2013 added a commit to Hercules2013/angular-electron that referenced this issue Oct 24, 2023
Boss930129 added a commit to Boss930129/angular_electron that referenced this issue Jun 6, 2024
Boss930129 added a commit to Boss930129/angular_electron that referenced this issue Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants