Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
Fix webpack config schema
Fix webpack extract text plugin schema
Remove babili package and add babel-minify-webpack-plugin (babel/minify#124)
  • Loading branch information
ph1p committed Nov 13, 2017
1 parent 1ec27bf commit 4f9ab34
Show file tree
Hide file tree
Showing 4 changed files with 5,338 additions and 5,719 deletions.
6 changes: 3 additions & 3 deletions config/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ module.exports = {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
use: 'babel-loader',
include: [
join(__dirname, '../src'),
join(__dirname, '../node_modules/buttercup-generator')
]
},
{
test: /\.(svg|png|ttf|woff|woff2)$/,
loader: 'file-loader',
use: 'file-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
use: ['style-loader', 'css-loader']
}
]
},
Expand Down
29 changes: 20 additions & 9 deletions config/webpack.config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { resolve } = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const BabiliPlugin = require('babili-webpack-plugin');
const MinifyPlugin = require('babel-minify-webpack-plugin');
const baseConfig = require('./webpack.config.base');

module.exports = merge(baseConfig, {
Expand All @@ -21,18 +21,29 @@ module.exports = merge(baseConfig, {
rules: [
{
test: /\.global\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader!sass-loader'
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
},

{
test: /^((?!\.global).)*\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader:
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass-loader'
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1,
localIdentName: '[name]__[local]___[hash:base64:5]'
}
},
{
loader: 'sass-loader'
}
]
})
}
]
Expand All @@ -47,7 +58,7 @@ module.exports = merge(baseConfig, {
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new BabiliPlugin(),
new MinifyPlugin(),
new ExtractTextPlugin({
filename: '[name].css',
allChunks: true
Expand Down
Loading

0 comments on commit 4f9ab34

Please sign in to comment.