From 21a8bd6982766b1b29bb51cc2e2294e9c3116866 Mon Sep 17 00:00:00 2001 From: MiroslavDionisiev Date: Thu, 13 Jun 2024 16:37:01 +0300 Subject: [PATCH 1/2] build: [UEPR-17] Cnanged resolve to use path defined in scratch-render exports --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 03e029637..aca3e3900 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -92,7 +92,7 @@ const playgroundBuilder = webBuilder.clone() } }) .addModuleRule({ - test: require.resolve('scratch-render/src/index.js'), + test: require.resolve('scratch-render'), loader: 'expose-loader', options: { exposes: 'ScratchRender' From 93f41d8cb0ff19c5fea23c3cb93870fdf0d88284 Mon Sep 17 00:00:00 2001 From: MiroslavDionisiev Date: Wed, 26 Jun 2024 16:50:39 +0300 Subject: [PATCH 2/2] refactor: [UEPR-17] Changed library name --- webpack.config.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index aca3e3900..ffe22d3f8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,13 @@ const common = { const nodeBuilder = new ScratchWebpackConfigBuilder(common) .setTarget('node') + .merge({ + output: { + library: { + name: 'VirtualMachine' + } + } + }) .addModuleRule({ test: /\.mp3$/, type: 'asset' @@ -24,6 +31,11 @@ const webBuilder = new ScratchWebpackConfigBuilder(common) fallback: { Buffer: require.resolve('buffer/') } + }, + output: { + library: { + name: 'VirtualMachine' + } } }) .addModuleRule({ @@ -56,7 +68,10 @@ const playgroundBuilder = webBuilder.clone() 'video-sensing-extension-debug': './src/extensions/scratch3_video_sensing/debug' }, output: { - path: path.resolve(__dirname, 'playground') + path: path.resolve(__dirname, 'playground'), + library: { + name: 'VirtualMachine' + } } }) .addModuleRule({