Skip to content

Commit

Permalink
fix: worker broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Jul 20, 2020
1 parent 9fa77e2 commit a46d5e0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/gulp/build-isolated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { buildWebpackTask, getWebpackConfig } from './helper'
import { output, IsolatedEntries } from './paths'
export const { build: workerBuild, watch: workerWatch } = buildWebpackTask(
'worker',
'Build Web Workers by Webpack',
'webpack',
'Build isolated entries (Web Worker and injected scripts) by Webpack',
(mode) => {
const conf = getWebpackConfig(mode, IsolatedEntries, output.workers.folder)
return conf
Expand Down
9 changes: 7 additions & 2 deletions scripts/gulp/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ export function getWebpackConfig(
return {
mode,
entry,
plugins: [new webpack.EnvironmentPlugin(getEnvironment(mode))],
plugins: [
new webpack.EnvironmentPlugin(getEnvironment(mode)),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
}),
],
devtool: isDev ? 'cheap-source-map' : false,
optimization: { splitChunks: false, minimize: false },
optimization: { splitChunks: false, minimize: false, runtimeChunk: false },
output: {
path: distPath,
globalObject: 'globalThis',
Expand Down
2 changes: 1 addition & 1 deletion src/webpack.preclude.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if (process.env.NODE_ENV === 'development') require('react-devtools')

const __deps__ = require('../temp/__deps__esm__generated__')
const __deps__ = require('../temp/__deps__esm__generated__').default
Object.assign(globalThis, { __deps__ })

// Requirement of webcrypto-liner
Expand Down
1 change: 0 additions & 1 deletion tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"importHelpers": "/polyfills/ttsclib.js",
"jsonImport": "inline",
"folderImport": true,
"umdCheckCompact": true,
"rules": {
"/(.+)/": {
"type": "umd",
Expand Down

0 comments on commit a46d5e0

Please sign in to comment.