From 415c9ef01ec1735198331aa3e717a39c77bae5d4 Mon Sep 17 00:00:00 2001 From: Zack Yang Date: Tue, 29 Nov 2016 00:19:13 +0800 Subject: [PATCH] refactor(webpack): update webpack config --- .travis.yml | 2 +- package.json | 8 ++++---- webpack.build.js | 5 ++--- webpack.config.js | 6 +++--- webpack.dev.js | 10 +++++----- webpack.test.js | 8 ++++---- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index e123318..7d9f125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ cache: notifications: email: false node_js: - - '4' + - '6' branches: only: - master diff --git a/package.json b/package.json index 7bcd709..4a8d017 100644 --- a/package.json +++ b/package.json @@ -31,11 +31,11 @@ "angular-material": "~1.1.0", "angular-material-icons": "~0.7.0", "angular-mocks": "~1.5.0", - "angular-sanji-window": "~2.1.0", + "angular-sanji-window": "~2.1.12", "codecov.io": "^0.1.6", "publish-latest": "~1.1.2", - "sanji-common-devs-ui": "~1.0.2", - "semantic-release": "^4.3.5", + "sanji-common-devs-ui": "~1.0.4", + "semantic-release": "^6.3.2", "svg-morpheus": "alexk111/SVG-Morpheus#v0.1.8", "toastr": "~2.1.2" }, @@ -55,4 +55,4 @@ "angular": "~1.5.0", "ng-file-upload": "~12.2.0" } -} +} \ No newline at end of file diff --git a/webpack.build.js b/webpack.build.js index 851e8ee..d4661c2 100644 --- a/webpack.build.js +++ b/webpack.build.js @@ -27,19 +27,18 @@ config.externals = { }; config.module.rules = [ - {test: /\.js$/, loader: 'ng-annotate', exclude: /(node_modules)/, enforce: 'post'}, + {test: /\.js$/, loader: 'ng-annotate-loader', exclude: /(node_modules)/, enforce: 'post'}, { test: /\.scss$/, loader: ExtractTextPlugin.extract({ notExtractLoader: 'style-loader', - loader: 'css!postcss!sass?includePaths[]=' + bourbon + loader: 'css-loader!postcss-loader!sass-loader?includePaths[]=' + bourbon }) } ].concat(config.module.rules); config.plugins.push( new ExtractTextPlugin('sanji-rest-ui.css'), - new webpack.optimize.DedupePlugin(), new webpack.LoaderOptionsPlugin({ minimize: true, debug: false, diff --git a/webpack.config.js b/webpack.config.js index 5c1daba..353fc07 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,9 +23,9 @@ const config = { }, module: { rules: [ - { test: /\.js$/, loader: 'eslint', exclude: /node_modules/, enforce: 'pre' }, - {test: /\.js$/, loader: 'babel?cacheDirectory', exclude: /(node_modules)/}, - { test: /\.html$/, loader: 'ng-cache?prefix=[dir]/[dir]', exclude: [/node_modules/, path.join(__dirname, '/app/index.html')] } + { test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/, enforce: 'pre' }, + {test: /\.js$/, loader: 'babel-loader?cacheDirectory', exclude: /(node_modules)/}, + { test: /\.html$/, loader: 'ng-cache-loader?prefix=[dir]/[dir]', exclude: [/node_modules/, path.join(__dirname, '/app/index.html')] } ] }, plugins: [ diff --git a/webpack.dev.js b/webpack.dev.js index b9169d5..a41bc62 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -13,12 +13,12 @@ config.entry = { ] }; config.module.rules = [ - {test: /\.js$/, loader: 'ng-annotate', exclude: /(node_modules)/, enforce: 'post'}, - {test: /\.scss/, loader: 'style!css!postcss!sass?includePaths[]=' + bourbon}, - {test: /\.css$/, loader: 'style!css!postcss?browsers=last 2 versions'}, + {test: /\.js$/, loader: 'ng-annotate-loader', exclude: /(node_modules)/, enforce: 'post'}, + {test: /\.scss/, loader: 'style-loader!css-loader!postcss-loader!sass-loader?includePaths[]=' + bourbon}, + {test: /\.css$/, loader: 'style-loader!css-loader!postcss-loader?browsers=last 2 versions'}, {test: /\.(png|jpg|gif|jpeg)$/, loader: 'url-loader?limit=8192', exclude: /node_modules/}, - {test: /\.(woff|woff2)$/, loader: 'url?limit=10000&minetype=application/font-woff', exclude: /node_modules/}, - {test: /\.(ttf|eot|svg)$/, loader: 'file', exclude: /node_modules/} + {test: /\.(woff|woff2)$/, loader: 'url-loader?limit=10000&minetype=application/font-woff', exclude: /node_modules/}, + {test: /\.(ttf|eot|svg)$/, loader: 'file-loader', exclude: /node_modules/} ].concat(config.module.rules); config.plugins.push( diff --git a/webpack.test.js b/webpack.test.js index ede040f..d800891 100644 --- a/webpack.test.js +++ b/webpack.test.js @@ -12,11 +12,11 @@ config.entry = {}; config.output = {}; config.module.rules = [ - {test: /\.scss/, loader: 'style!css!postcss!sass?includePaths[]=' + bourbon}, - {test: /\.css$/, loader: 'style!css!postcss'}, + {test: /\.scss/, loader: 'style-loader!css-loader!postcss-loader!sass-loader?includePaths[]=' + bourbon}, + {test: /\.css$/, loader: 'style-loader!css-loader!postcss-loader'}, {test: /\.(png|jpg|gif|jpeg)$/, loader: 'url-loader?limit=8192'}, - {test: /\.(woff|woff2)$/, loader: 'url?limit=10000&minetype=application/font-woff'}, - {test: /\.(ttf|eot|svg)$/, loader: 'file'} + {test: /\.(woff|woff2)$/, loader: 'url-loader?limit=10000&minetype=application/font-woff'}, + {test: /\.(ttf|eot|svg)$/, loader: 'file-loader'} ].concat(config.module.rules); config.plugins.push(