Add missing variable for worker

This commit is contained in:
Tornado Contrib 2024-10-06 02:29:21 +00:00
parent 51f737b728
commit 4517393017
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
3 changed files with 12 additions and 1 deletions

@ -1,3 +1,5 @@
globalThis.process = { browser: true, env: {}, };
(function webpackUniversalModuleDefinition(root, factory) { (function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object') if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(); module.exports = factory();

File diff suppressed because one or more lines are too long

@ -1,3 +1,4 @@
const { BannerPlugin } = require('webpack');
const path = require('path'); const path = require('path');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
@ -82,6 +83,10 @@ module.exports = [
}, },
plugins: [ plugins: [
new NodePolyfillPlugin(), new NodePolyfillPlugin(),
new BannerPlugin({
banner: 'globalThis.process = { browser: true, env: {}, };\n',
raw: true,
}),
], ],
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js'], extensions: ['.tsx', '.ts', '.js'],
@ -106,6 +111,10 @@ module.exports = [
}, },
plugins: [ plugins: [
new NodePolyfillPlugin(), new NodePolyfillPlugin(),
new BannerPlugin({
banner: 'globalThis.process = { browser: true, env: {}, };',
raw: true,
}),
], ],
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js'], extensions: ['.tsx', '.ts', '.js'],