Skip to content

Commit

Permalink
webpack: Removed happypack
Browse files Browse the repository at this point in the history
This was done to address issues with enumerating network devices on Ubuntu for Windows,
which requires for node to be patched at runtime.

See:
https://github.com/CherryDT/wsl_node_network_interfaces_shim
microsoft/WSL#468
  • Loading branch information
notatestuser committed Mar 15, 2017
1 parent 6683099 commit 5603680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"git-rev-sync": "1.8.0",
"glob": "7.1.1",
"handlebars-loader": "1.4.0",
"happypack": "^3.0.3",
"history": "3.2.1",
"html-webpack-plugin": "e1-bsd/html-webpack-plugin#3193e3d299ff1b379110eac2909ef945283ab379",
"image-webpack-loader": "3.0.0",
Expand Down
30 changes: 2 additions & 28 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@

'use strict';

const os = require('os');
const path = require('path');
const webpack = require('webpack');
const combineLoaders = require('webpack-combine-loaders');
const git = require('git-rev-sync');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const Visualizer = require('webpack-visualizer-plugin');
const HappyPack = require('happypack');

const packageInfo = require(path.resolve('package.json'));
const version = packageInfo.version;
Expand All @@ -32,9 +30,6 @@ const regExpFonts = new RegExp(`fonts\\${path.sep}.+\\.(woff2?|ttf|eot|otf|svg)$
const regExpInlineSvgs = new RegExp(`(\\.inline\\.svg$)|(components\\${path.sep}Icon\\${path.sep}.+\\.svg$)`);
const regExpFavicons = new RegExp(`assets\\${path.sep}favicons\\${path.sep}.+$`);

HappyPack.SERIALIZABLE_OPTIONS = HappyPack.SERIALIZABLE_OPTIONS.concat(['postcss']);
const happyPackThreadPool = new HappyPack.ThreadPool({ size: os.cpus().length });

const BABEL_CACHE_ENABLED = true;

const jsxLoader = combineLoaders([
Expand Down Expand Up @@ -82,15 +77,15 @@ module.exports = {
{
test: /\.jsx?$/,
exclude: excluded,
loader: isDev ? 'happypack/loader?id=jsx' : jsxLoader,
loader: jsxLoader,
},
{
test: /\.css$/,
loader: 'style!css?root=.',
},
{
test: /\.postcss$/,
loader: isDev ? 'happypack/loader?id=postcss' : postcssLoader,
loader: postcssLoader,
},
{
test: regExpFonts,
Expand Down Expand Up @@ -157,27 +152,6 @@ module.exports = {
}),
] :
[])
.concat(isDev ?
[
new HappyPack({
id: 'jsx',
cache: ! BABEL_CACHE_ENABLED,
threadPool: happyPackThreadPool,
loaders: [jsxLoader],
cacheContext: {
env: process.env.NODE_ENV,
},
}),
new HappyPack({
id: 'postcss',
threadPool: happyPackThreadPool,
loaders: [postcssLoader],
cacheContext: {
env: process.env.NODE_ENV,
},
}),
] :
[])
.concat([
new HtmlWebpackPlugin({
template: path.join(__dirname, 'lib/index.html'),
Expand Down

0 comments on commit 5603680

Please sign in to comment.