...
|
...
|
@@ -6,19 +6,13 @@ |
|
|
|
|
|
'use strict';
|
|
|
|
|
|
const os = require('os');
|
|
|
const path = require('path');
|
|
|
const shelljs = require('shelljs');
|
|
|
const _ = require('lodash');
|
|
|
const webpack = require('webpack');
|
|
|
const HappyPack = require('happypack');
|
|
|
const { cssLoader, hbsLoader } = require('./utils.js');
|
|
|
const postcssConfig = require('./postcss.config.js');
|
|
|
|
|
|
const happyThreadPool = HappyPack.ThreadPool({ // eslint-disable-line
|
|
|
size: os.cpus().length
|
|
|
});
|
|
|
|
|
|
|
|
|
const getEntries = () => {
|
|
|
const entries = {
|
...
|
...
|
@@ -83,16 +77,14 @@ module.exports = (env) => { |
|
|
test: /\.js$/,
|
|
|
exclude: [/node_modules/],
|
|
|
use: [{
|
|
|
loader: 'happypack/loader?id=js'
|
|
|
loader: 'babel-loader'
|
|
|
}]
|
|
|
}, {
|
|
|
test: /\.css$/,
|
|
|
use: cssLoader(env, 'css')
|
|
|
}, {
|
|
|
test: /\.hbs$/,
|
|
|
use: [{
|
|
|
loader: 'happypack/loader?id=hbs'
|
|
|
}]
|
|
|
use: [hbsLoader]
|
|
|
}]
|
|
|
},
|
|
|
resolve: {
|
...
|
...
|
@@ -138,21 +130,6 @@ module.exports = (env) => { |
|
|
maxAssetSize: 512000
|
|
|
},
|
|
|
plugins: [
|
|
|
new HappyPack({
|
|
|
id: 'js',
|
|
|
threadPool: happyThreadPool,
|
|
|
loaders: ['babel-loader'],
|
|
|
}),
|
|
|
new HappyPack({
|
|
|
id: 'hbs',
|
|
|
threadPool: happyThreadPool,
|
|
|
loaders: [hbsLoader]
|
|
|
}),
|
|
|
|
|
|
// new webpack.optimize.CommonsChunkPlugin({
|
|
|
// name: 'libs',
|
|
|
// filename: 'libs.js'
|
|
|
// }),
|
|
|
new webpack.ProvidePlugin({
|
|
|
$: 'yoho-jquery',
|
|
|
jQuery: 'yoho-jquery',
|
...
|
...
|
|