From aa3f6086606aebf328f020325e1cd8e2f1b1f738 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Wed, 19 Jul 2017 14:17:17 +0100 Subject: Add happypack for babel-loader --- config/webpack.config.js | 8 +++++++- package.json | 1 + yarn.lock | 21 +++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index c3fdca59a86..b4a4f8e2284 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -8,6 +8,7 @@ var CompressionPlugin = require('compression-webpack-plugin'); var NameAllModulesPlugin = require('name-all-modules-plugin'); var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); +var HappyPack = require('happypack'); var ROOT_PATH = path.resolve(__dirname, '..'); var IS_PRODUCTION = process.env.NODE_ENV === 'production'; @@ -86,7 +87,7 @@ var config = { { test: /\.js$/, exclude: /(node_modules|vendor\/assets)/, - loader: 'babel-loader', + loader: 'happypack/loader?id=babel', }, { test: /\.vue$/, @@ -114,6 +115,11 @@ var config = { }, plugins: [ + new HappyPack({ + id: 'babel', + loaders: ['babel-loader'], + }), + // manifest filename must match config.webpack.manifest_filename // webpack-rails only needs assetsByChunkName to function properly new StatsPlugin('manifest.json', { diff --git a/package.json b/package.json index 5a997e813f8..b1a2da7b75e 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "eslint-plugin-html": "^2.0.1", "exports-loader": "^0.6.4", "file-loader": "^0.11.1", + "happypack": "^4.0.0-beta.1", "jed": "^1.1.1", "jquery": "^2.2.1", "jquery-ujs": "^1.2.1", diff --git a/yarn.lock b/yarn.lock index b04eebe60af..55e6ff7f387 100644 --- a/yarn.lock +++ b/yarn.lock @@ -196,6 +196,10 @@ async@0.2.x: version "0.2.10" resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" +async@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.0.tgz#2796642723573859565633fc6274444bee2f8ce3" + async@1.x, async@^1.4.0, async@^1.4.2, async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -2549,6 +2553,15 @@ handlebars@^4.0.1, handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" +happypack@^4.0.0-beta.1: + version "4.0.0-beta.1" + resolved "https://registry.yarnpkg.com/happypack/-/happypack-4.0.0-beta.1.tgz#1b81b11ab8fad2cd23fa3cec82052ee291614ead" + dependencies: + async "1.5.0" + json-stringify-safe "5.0.1" + loader-utils "0.2.16" + serialize-error "^2.1.0" + har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" @@ -3176,7 +3189,7 @@ json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: +json-stringify-safe@5.0.1, json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -3338,7 +3351,7 @@ loader-runner@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" -loader-utils@^0.2.11, loader-utils@^0.2.16, loader-utils@^0.2.5: +loader-utils@0.2.16, loader-utils@^0.2.11, loader-utils@^0.2.16, loader-utils@^0.2.5: version "0.2.16" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d" dependencies: @@ -4929,6 +4942,10 @@ send@0.15.3: range-parser "~1.2.0" statuses "~1.3.1" +serialize-error@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a" + serve-index@^1.7.2: version "1.8.0" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.8.0.tgz#7c5d96c13fb131101f93c1c5774f8516a1e78d3b" -- cgit v1.2.3