@andrewtest/swc
v1.0.10
Published
glass swc plugin
Downloads
1
Readme
publishing the package
To build the .wasm file, run these two commands:
run
cargo build --target wasm32-wasi --release
- this generates the .wasm file using Rustrun
cp ./target/wasm32-wasi/release/glass_swc.wasm .
- this copies the wasm file to the root where package.json expects it
To publish the package to npm (the entry point of the package is the .wasm file), do this:
increment package.json's version number
run
npm publish --access public
updating and versions
The @swc/core npm package used in the user's frontend needs to be compatible with the .wasm file generated here.
We'll always assume the user is working with the latest version of @swc/core, npm show @swc/core version
. We must use a compatible version of swc_core in Cargo. See https://swc.rs/docs/plugin/selecting-swc-core.
Cargo.toml contains the swc_core
version, and package.json here has peerDependencies that indicate the @swc/core
version. We'll need to update both when new releases are made. To find version of swc_core, we can use cargo search swc_core
or check the site crates.io
.
versioning notes
^1.6.2 means 1.6.2 thru (excluding) 2.0.0
~1.6.2 means 1.6.2 thru (excluding) 1.7.0
1.6.x means 1.6.0 thru (excluding) 1.7.0