Use comlink in workers (#5915)

This commit is contained in:
Paulus Schoutsen
2020-05-18 07:51:46 -07:00
committed by GitHub
parent d38a0f0366
commit a66d2ca1b9
10 changed files with 117 additions and 81 deletions

View File

@@ -2,6 +2,7 @@ const webpack = require("webpack");
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const ManifestPlugin = require("webpack-manifest-plugin");
const WorkerPlugin = require("worker-plugin");
const paths = require("./paths.js");
const env = require("./env.js");
const { babelLoaderConfig } = require("./babel.js");
@@ -51,6 +52,7 @@ const createWebpackConfig = ({
],
},
plugins: [
new WorkerPlugin(),
new ManifestPlugin(),
new webpack.DefinePlugin({
__DEV__: !isProdBuild,
@@ -105,7 +107,7 @@ const createWebpackConfig = ({
latestBuild ? "frontend_latest" : "frontend_es5"
),
publicPath: latestBuild ? "/frontend_latest/" : "/frontend_es5/",
// For workerize loader
// To silence warning in worker plugin
globalObject: "self",
},
};