Skip to content

Commit

Permalink
refactor(webpack): update webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
zack9433 committed Nov 28, 2016
1 parent d21f8ce commit 415c9ef
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:
notifications:
email: false
node_js:
- '4'
- '6'
branches:
only:
- master
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -55,4 +55,4 @@
"angular": "~1.5.0",
"ng-file-upload": "~12.2.0"
}
}
}
5 changes: 2 additions & 3 deletions webpack.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
10 changes: 5 additions & 5 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions webpack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 415c9ef

Please sign in to comment.