Skip to content

Commit 1df3978

Browse files
committed
chore(build): minor code & plugins optimizations
1 parent b168fa4 commit 1df3978

7 files changed

Lines changed: 30 additions & 20 deletions

File tree

.eslintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"jasmine": true,
3232
"node": true
3333
},
34-
"ecmaFeatures": {
35-
"modules": true
36-
},
3734
"parserOptions": {
35+
"ecmaFeatures": {
36+
"modules": true
37+
},
3838
"sourceType": "module"
3939
},
4040
"globals" : {

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules/
66
.vscode/settings.json
77
*.DS_Store
88
npm-debug.log
9+
yarn-error.log

src/app/root.module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import angular from 'angular';
2-
import uiRouter from 'angular-ui-router';
2+
import uiRouter from '@uirouter/angularjs';
33
import ngMaterial from 'angular-material';
44
import '../sass/main.scss';
55
import { RootComponent } from './root.component';

src/sass/includes/_includes.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// vendor
22
@import '~angular-material/angular-material.css';
33
@import '"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"';
4-

webpack.base.conf.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
const path = require('path');
2-
const webpack = require('webpack');
3-
const NODE_ENV = process.argv.indexOf('-p') !== -1 ? 'production' : 'development';
4-
const ROOT_PATH = path.resolve(__dirname, './');
5-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
const NODE_ENV = process.argv.indexOf('-p') !== -1 ? 'production' : 'development';
4+
const ROOT_PATH = path.resolve(__dirname, './');
5+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
6+
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
67

78
const sassImports = [
89
`${ROOT_PATH}/src/sass/includes/_includes.scss`,
@@ -21,6 +22,7 @@ const isExternal = (module) => {
2122
return userRequest.indexOf('node_modules') >= 0;
2223
};
2324

25+
process.traceDeprecation = true;
2426

2527
module.exports = {
2628

@@ -93,9 +95,10 @@ module.exports = {
9395
}),
9496

9597
new ExtractTextPlugin({
96-
filename : 'styles/[name].[hash].css',
97-
allChunks : true,
98-
disable : !isProduction()
98+
filename : isProduction() ? 'styles/[name].[hash].css' : 'styles/[name].css',
99+
allChunks : true
99100
}),
101+
102+
new FriendlyErrorsPlugin()
100103
]
101104
};

webpack.dev.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ module.exports = merge(baseConfig, {
1313
overlay: {
1414
warnings: true,
1515
errors: true
16+
},
17+
stats: {
18+
assets: true,
19+
children: false,
20+
chunks: false,
21+
hash: false,
22+
modules: false,
23+
publicPath: false,
24+
timings: true,
25+
version: false,
26+
warnings: true,
27+
colors: {
28+
green: '\u001b[32m',
29+
}
1630
}
1731
},
1832

webpack.prod.config.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const baseConfig = require('./webpack.base.conf');
22
const merge = require('webpack-merge');
33
const CleanWebpackPlugin = require('clean-webpack-plugin');
44
const HtmlWebpackPlugin = require('html-webpack-plugin');
5-
const PreloadWebpackPlugin = require('preload-webpack-plugin');
65

76
module.exports = merge(baseConfig, {
87

@@ -26,12 +25,6 @@ module.exports = merge(baseConfig, {
2625
removeScriptTypeAttributes : true,
2726
removeStyleLinkTypeAttributes : true
2827
}
29-
}),
30-
31-
new PreloadWebpackPlugin({
32-
rel: 'preload',
33-
as: 'script',
34-
include: 'all'
3528
})
3629
]
3730

0 commit comments

Comments
 (0)