From eb0bbb445bd63aac9d831e433ecd45a120130c64 Mon Sep 17 00:00:00 2001 From: Anastasiia Sliusar Date: Thu, 5 Dec 2024 11:52:36 +0100 Subject: [PATCH] Update webpack config --- package.json | 1 + worker.webpack.config.js | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6345871..217f477 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "@types/react-addons-linked-state-mixin": "^0.14.22", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", + "copy-webpack-plugin": "^10.0.0", "css-loader": "^6.7.1", "eslint": "^8.36.0", "eslint-config-prettier": "^8.8.0", diff --git a/worker.webpack.config.js b/worker.webpack.config.js index f771a60..215574a 100644 --- a/worker.webpack.config.js +++ b/worker.webpack.config.js @@ -1,4 +1,22 @@ const path = require('path'); +const CopyPlugin = require('copy-webpack-plugin'); + +const occPath = [ + __dirname, + 'node_modules', + '@emscripten-forge/mambajs', + 'node_modules', + '@emscripten-forge/untarjs', + 'lib', + 'unpack.wasm' +]; +const staticPath = [ + __dirname, + 'jupyterlite_xeus', + 'labextension', + 'static', + '[name].wasm' +]; const rules = [ { @@ -48,6 +66,16 @@ module.exports = [ rules }, devtool: 'source-map', - resolve + resolve, + plugins: [ + new CopyPlugin({ + patterns: [ + { + from: path.join(...occPath), + to: path.join(...staticPath) + } + ] + }) + ] } ]; \ No newline at end of file