Skip to content

Commit

Permalink
wasm-32-wasi to wasm32-wasip1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeigs committed Jan 9, 2025
1 parent 222ba45 commit e81d008
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The component factory filter process uses [SWC](https://swc.rs/) to remove unuse

To use the custom plugin, you'll first need to install [Rust](https://www.rust-lang.org/tools/install).

Once Rust is installed, you'll need to build the plugin. Change directory to `component-factory-transformer`, run `cargo build && rustup target add wasm32-wasi` if you haven't, and then run `npm run prepublishOnly`.
Once Rust is installed, you'll need to build the plugin. Change directory to `component-factory-transformer`, run `cargo build && rustup target add wasm32-wasip1` if you haven't, and then run `npm run prepublishOnly`.

The `USE_FILTER_BRANCH` environment variable needs to be added in the `.env.production` file and set to `true` for this to work.

Expand Down
2 changes: 1 addition & 1 deletion component-factory-transformer/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These command aliases are not final, may change
[alias]
# Alias to build actual plugin binary for the specified target.
build-wasi = "build --target wasm32-wasi"
build-wasi = "build --target wasm32-wasip1"
build-wasm32 = "build --target wasm32-unknown-unknown"
2 changes: 1 addition & 1 deletion component-factory-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "",
"license": "ISC",
"keywords": ["swc-plugin"],
"main": "target/wasm32-wasi/release/component-factory-transformer.wasm",
"main": "target/wasm32-wasip1/release/component-factory-transformer.wasm",
"scripts": {
"prepublishOnly": "cargo build-wasi --release"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/gatsby-source-snooty-prod/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
experimental: {
plugins: [
[
`${process.cwd()}/component-factory-transformer/target/wasm32-wasi/release/component_factory_filter.wasm`,
`${process.cwd()}/component-factory-transformer/target/wasm32-wasip1/release/component_factory_filter.wasm`,
{ includes: [...Array.from(projectComponents)] },
],
],
Expand Down

0 comments on commit e81d008

Please sign in to comment.