Skip to content

Commit c62be6e

Browse files
committed
Fixed double import warning of AngularJS
1 parent 02198f5 commit c62be6e

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

conf/webpack.conf.build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ module.exports = Object.assign(webpackConfig, {
3030
}
3131
})
3232
])
33-
3433
});

conf/webpack.conf.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@ const autoprefixer = require('autoprefixer');
88
const dirSrc = path.join(__dirname, '../src');
99
const dirNodeModules = path.join(__dirname, '../node_modules');
1010

11-
const pkg = require(path.join(__dirname, '../package.json'));
12-
1311
const IS_DEV = (process.env.NODE_ENV === 'dev');
1412

1513
module.exports = {
14+
plugins: [
15+
new webpack.optimize.OccurrenceOrderPlugin(),
16+
new webpack.NoEmitOnErrorsPlugin(),
17+
new HtmlWebpackPlugin({
18+
template: path.join(dirSrc, 'index.html')
19+
}),
20+
new ExtractTextPlugin('[name].[contenthash].css')
21+
],
22+
entry: {
23+
app: path.join(dirSrc, 'index'),
24+
vendor: ['babel-polyfill', 'angular', '@uirouter/angularjs']
25+
},
1626
module: {
1727
rules: [
1828
{
@@ -72,17 +82,5 @@ module.exports = {
7282
}
7383
}
7484
]
75-
},
76-
plugins: [
77-
new webpack.optimize.OccurrenceOrderPlugin(),
78-
new webpack.NoEmitOnErrorsPlugin(),
79-
new HtmlWebpackPlugin({
80-
template: path.join(dirSrc, 'index.html')
81-
}),
82-
new ExtractTextPlugin('[name].[contenthash].css')
83-
],
84-
entry: {
85-
app: path.join(dirSrc, 'index'),
86-
vendor: Object.keys(pkg.dependencies)
8785
}
8886
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"license": "ISC",
77
"dependencies": {
88
"@uirouter/angularjs": "^1.0.10",
9-
"angular": "^1.6.6"
9+
"angular": "^1.6.6",
10+
"normalize-scss": "^7.0.0",
11+
"box-sizing-border-box": "^1.0.1"
1012
},
1113
"devDependencies": {
1214
"autoprefixer": "^7.1.6",
@@ -15,7 +17,6 @@
1517
"babel-loader": "^7.1.2",
1618
"babel-polyfill": "^6.26.0",
1719
"babel-preset-env": "^1.6.1",
18-
"box-sizing-border-box": "^1.0.1",
1920
"clean-webpack-plugin": "^0.1.17",
2021
"css-loader": "^0.28.7",
2122
"eslint": "^4.9.0",
@@ -30,7 +31,6 @@
3031
"html-webpack-plugin": "^2.30.1",
3132
"ng-annotate-loader": "^0.6.1",
3233
"node-sass": "^4.5.3",
33-
"normalize-scss": "^7.0.0",
3434
"postcss-loader": "^2.0.8",
3535
"sass-loader": "^6.0.6",
3636
"style-loader": "^0.19.0",

0 commit comments

Comments
 (0)