Update webpack

This commit is contained in:
Jaco Greeff 2017-08-04 14:28:55 +02:00
parent 44a7c3d0b6
commit 49a4499d52
5 changed files with 30 additions and 19 deletions

View File

@ -68,7 +68,12 @@ module.exports = {
{ {
test: /\.js$/, test: /\.js$/,
exclude: /node_modules/, exclude: /node_modules/,
use: ['happypack/loader?id=babel'] use: [ {
loader: 'happypack/loader',
options: {
id: 'babel'
}
} ]
}, },
{ {
test: /\.json$/, test: /\.json$/,
@ -91,7 +96,7 @@ module.exports = {
{ {
loader: 'css-loader', loader: 'css-loader',
options: { options: {
minimize: true minimize: isProd
} }
} }
] ]
@ -108,14 +113,14 @@ module.exports = {
options: { options: {
importLoaders: 1, importLoaders: 1,
localIdentName: '[name]_[local]_[hash:base64:10]', localIdentName: '[name]_[local]_[hash:base64:10]',
minimize: true, minimize: isProd,
modules: true modules: true
} }
}, },
{ {
loader: 'postcss-loader', loader: 'postcss-loader',
options: { options: {
sourceMap: true, sourceMap: isProd,
plugins: [ plugins: [
require('postcss-import'), require('postcss-import'),
require('postcss-nested'), require('postcss-nested'),

View File

@ -44,7 +44,7 @@ module.exports = {
resolve: { resolve: {
alias: { alias: {
'~': path.resolve(__dirname, '..')
} }
}, },
@ -59,7 +59,12 @@ module.exports = {
{ {
test: /\.js$/, test: /\.js$/,
exclude: /node_modules/, exclude: /node_modules/,
use: [ 'happypack/loader?id=babel' ] use: [ {
loader: 'happypack/loader',
options: {
id: 'babel'
}
} ]
}, },
{ {
test: /\.json$/, test: /\.json$/,

View File

@ -58,7 +58,7 @@ module.exports = {
rulesEs6, rulesEs6,
{ {
test: /(\.jsx|\.js)$/, test: /(\.jsx|\.js)$/,
use: [ 'babel-loader' ], use: ['babel-loader'],
exclude: /node_modules/ exclude: /node_modules/
} }
] ]
@ -68,18 +68,9 @@ module.exports = {
}, },
resolve: { resolve: {
alias: { alias: {
'~': path.resolve(__dirname, '..'), '~': path.resolve(__dirname, '..')
'@parity/abi': path.resolve(__dirname, '../node_modules/@parity/abi'),
'@parity/api': path.resolve(__dirname, '../node_modules/@parity/api'),
'@parity/etherscan': path.resolve(__dirname, '../node_modules/@parity/etherscan'),
'@parity/jsonrpc': path.resolve(__dirname, '../node_modules/@parity/jsonrpc'),
'@parity/shared': path.resolve(__dirname, '../node_modules/@parity/shared'),
'@parity/ui': path.resolve(__dirname, '../node_modules/@parity/ui'),
'@parity/wordlist': path.resolve(__dirname, '../node_modules/@parity/wordlist'),
'@parity': path.resolve(__dirname, '../packages')
}, },
modules: [ modules: [
path.resolve('./src'),
path.join(__dirname, '../node_modules') path.join(__dirname, '../node_modules')
], ],
extensions: ['.json', '.js', '.jsx'] extensions: ['.json', '.js', '.jsx']

View File

@ -17,5 +17,10 @@
module.exports = { module.exports = {
test: /\.js$/, test: /\.js$/,
include: /node_modules\/(get-own-enumerable-property-symbols|ethereumjs-tx|stringify-object)/, include: /node_modules\/(get-own-enumerable-property-symbols|ethereumjs-tx|stringify-object)/,
use: [ 'happypack/loader?id=babel' ] use: [ {
loader: 'happypack/loader',
options: {
id: 'babel'
}
} ]
}; };

View File

@ -17,5 +17,10 @@
module.exports = { module.exports = {
test: /\.js$/, test: /\.js$/,
include: /node_modules\/@parity\//, include: /node_modules\/@parity\//,
use: [ 'happypack/loader?id=babel' ] use: [ {
loader: 'happypack/loader',
options: {
id: 'babel'
}
} ]
}; };