Skip to content

Commit

Permalink
Bundle napi-wasm dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Aug 20, 2023
1 parent 970fa1b commit 21deea4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lightningcss",
"version": "1.21.6",
"version": "1.21.7",
"license": "MPL-2.0",
"description": "A CSS parser, transformer, and minifier written in Rust",
"main": "node/index.js",
Expand Down
2 changes: 2 additions & 0 deletions scripts/build-wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function init(input?: string | URL | Request): Promise<void>;
fs.writeFileSync(`${dir}/wasm/index.d.ts`, dts);
fs.copyFileSync(`${dir}/node/targets.d.ts`, `${dir}/wasm/targets.d.ts`);
fs.copyFileSync(`${dir}/node/ast.d.ts`, `${dir}/wasm/ast.d.ts`);
fs.cpSync(`${dir}/node_modules/napi-wasm`, `${dir}/wasm/node_modules/napi-wasm`, {recursive: true});

let readme = fs.readFileSync(`${dir}/README.md`, 'utf8');
readme = readme.replace('# ⚡️ Lightning CSS', '# ⚡️ lightningcss-wasm');
Expand All @@ -42,6 +43,7 @@ wasmPkg.files = ['*.js', '*.mjs', '*.d.ts', '*.flow', '*.wasm'];
wasmPkg.dependencies = {
'napi-wasm': pkg.devDependencies['napi-wasm']
};
wasmPkg.bundledDependencies = ['napi-wasm']; // for stackblitz
delete wasmPkg.napi;
delete wasmPkg.devDependencies;
delete wasmPkg.optionalDependencies;
Expand Down

0 comments on commit 21deea4

Please sign in to comment.