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 0801388
Showing 1 changed file with 2 additions and 0 deletions.
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 0801388

Please sign in to comment.