Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Dec 6, 2023
1 parent bbd5a5f commit 66262dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
node-version: "16"
- run: npm ci
- name: Build Playground
run: npm run build
run: |
wasm-pack build --verbose ./ffi/wasm
npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright test
Expand Down
21 changes: 12 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ module.exports = {
}),
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({ template: "index.html" }),
// WasmPackPlugin can not work in CI environment
!process.env.CI
? new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, "./ffi/wasm/"),
outDir: path.resolve(__dirname, "./ffi/wasm/pkg/"),
forceMode: "production",
})
: undefined,
// WasmPackPlugin doesn't work in CI environment
// thanks to https://github.com/wasm-tool/wasm-pack-plugin/issues/90
...(!process.env.CI
? [
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, "./ffi/wasm/"),
outDir: path.resolve(__dirname, "./ffi/wasm/pkg/"),
forceMode: "production",
}),
]
: []),
new CopyWebpackPlugin({
patterns: [
{
Expand All @@ -65,7 +68,7 @@ module.exports = {
},
],
}),
].filter(Boolean),
],
module: {
rules: [
{
Expand Down

0 comments on commit 66262dc

Please sign in to comment.