summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-12-16 00:24:18 +0000
committerPhil Hughes <me@iamphill.com>2017-12-16 00:24:18 +0000
commita69e7affbca9bbfe8fb9a51ab1646f81d8ade339 (patch)
treeee0b0b5b39a554c744370270e09a67fc0313202b
parentdf4fe43d73c10db447fb08317bf4bf20878a2bfc (diff)
downloadgitlab-ce-diff-worker-js-fix.tar.gz
changed webpack configdiff-worker-js-fix
-rw-r--r--app/assets/javascripts/repo/lib/diff/diff_worker.js3
-rw-r--r--config/webpack.config.js5
2 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/repo/lib/diff/diff_worker.js b/app/assets/javascripts/repo/lib/diff/diff_worker.js
index 105431442af..e74c4046330 100644
--- a/app/assets/javascripts/repo/lib/diff/diff_worker.js
+++ b/app/assets/javascripts/repo/lib/diff/diff_worker.js
@@ -1,7 +1,6 @@
import { computeDiff } from './diff';
-// eslint-disable-next-line prefer-arrow-callback
-self.addEventListener('message', function diffWorker(e) {
+self.addEventListener('message', (e) => {
const data = e.data;
self.postMessage({
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 78ced4c3e8c..e850f6174b1 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -118,7 +118,10 @@ var config = {
},
{
test: /\_worker\.js$/,
- loader: 'worker-loader',
+ use: [
+ { loader: 'worker-loader' },
+ { loader: 'babel-loader' },
+ ],
},
{
test: /\.(worker(\.min)?\.js|pdf|bmpr)$/,