@@ -10,9 +10,10 @@ const postcssUrl = require('postcss-url');
10
10
const customProperties = require ( 'postcss-custom-properties' ) ;
11
11
12
12
const { NoEmitOnErrorsPlugin, SourceMapDevToolPlugin, DefinePlugin, NamedModulesPlugin } = require ( 'webpack' ) ;
13
- const { BaseHrefWebpackPlugin, NamedLazyChunksWebpackPlugin } = require ( '@angular/cli/plugins/webpack' ) ;
13
+ const { BaseHrefWebpackPlugin, NamedLazyChunksWebpackPlugin, InsertConcatAssetsWebpackPlugin } = require ( '@angular/cli/plugins/webpack' ) ;
14
14
const { CommonsChunkPlugin } = require ( 'webpack' ) . optimize ;
15
15
const { AngularCompilerPlugin } = require ( '@ngtools/webpack' ) ;
16
+ const ConcatPlugin = require ( 'webpack-concat-plugin' ) ;
16
17
17
18
const nodeModules = path . join ( process . cwd ( ) , 'node_modules' ) ;
18
19
const realNodeModules = fs . realpathSync ( nodeModules ) ;
@@ -84,15 +85,18 @@ function getPlugins() {
84
85
85
86
plugins . push ( new NoEmitOnErrorsPlugin ( ) ) ;
86
87
87
- // if(scripts.length > 0) {
88
- // plugins.push(new ConcatPlugin({
89
- // "uglify": false,
90
- // "sourceMap": true,
91
- // "name": "scripts",
92
- // "fileName": "[name].bundle.js",
93
- // "filesToConcat": scripts
94
- // }));
95
- // }
88
+ if ( scripts . length > 0 ) {
89
+ plugins . push ( new ConcatPlugin ( {
90
+ "uglify" : false ,
91
+ "sourceMap" : true ,
92
+ "name" : "scripts" ,
93
+ "fileName" : "[name].bundle.js" ,
94
+ "filesToConcat" : scripts
95
+ } ) ) ;
96
+ plugins . push ( new InsertConcatAssetsWebpackPlugin ( [
97
+ "scripts"
98
+ ] ) ) ;
99
+ }
96
100
97
101
plugins . push ( new CopyWebpackPlugin ( [
98
102
{
0 commit comments