From 0fed50681711d8b6cd2693ccff0fe0c34e494361 Mon Sep 17 00:00:00 2001 From: c-bata Date: Wed, 7 Aug 2024 21:50:58 +0900 Subject: [PATCH 1/2] Fix the build of vscode extension --- .github/workflows/typescript-tests.yml | 10 ++++++++++ standalone_app/webpack.config.js | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/typescript-tests.yml b/.github/workflows/typescript-tests.yml index 26c98501..33c7725d 100644 --- a/.github/workflows/typescript-tests.yml +++ b/.github/workflows/typescript-tests.yml @@ -112,6 +112,16 @@ jobs: - name: Setup tslib run: make tslib + - name: Build standalone_app for vscode extension + working-directory: standalone_app + run: | + npm run build:vscode + + - name: Build standalone_app for GitHub pages + working-directory: standalone_app + run: | + npx vite build --out-dir ./gh-pages + - name: Build bundle.js working-directory: optuna_dashboard run: | diff --git a/standalone_app/webpack.config.js b/standalone_app/webpack.config.js index 4c599a49..ed589617 100644 --- a/standalone_app/webpack.config.js +++ b/standalone_app/webpack.config.js @@ -36,6 +36,12 @@ module.exports = { test: /\.wasm$/, type: "asset/inline", }, + { + test: /\.m?js/, + resolve: { + fullySpecified: false + } + } ] }, resolve: { From 5c995c4bff67d9328d4942630b08d820c0207ac3 Mon Sep 17 00:00:00 2001 From: c-bata Date: Wed, 7 Aug 2024 21:59:37 +0900 Subject: [PATCH 2/2] Fix github workflow --- .github/workflows/typescript-tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/typescript-tests.yml b/.github/workflows/typescript-tests.yml index 33c7725d..88f186c5 100644 --- a/.github/workflows/typescript-tests.yml +++ b/.github/workflows/typescript-tests.yml @@ -109,17 +109,25 @@ jobs: with: node-version: '20' + - name: Build rustlib for standalone_app + working-directory: rustlib + run: | + curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + wasm-pack build --target web + - name: Setup tslib run: make tslib - name: Build standalone_app for vscode extension working-directory: standalone_app run: | + npm install npm run build:vscode - name: Build standalone_app for GitHub pages working-directory: standalone_app run: | + npm install npx vite build --out-dir ./gh-pages - name: Build bundle.js