Skip to content

Commit 9c0a0f5

Browse files
Copilothzhangxyz
andauthored
Compile embind to single file without source maps (#85)
* Initial plan * Compile embind to single file and disable source maps - Added -s SINGLE_FILE=1 to emcc command - Removed -gsource-map=inline from emcc command - Removed source map files from package.json files array - Disabled sourcemap in rollup.config.mjs - Removed ds.wasm.map from copy patterns Co-authored-by: hzhangxyz <[email protected]> * Remove ds.wasm from files, remove copy plugin, and remove explicit sourcemap config - Removed dist/ds.wasm from files array (no longer generated with SINGLE_FILE=1) - Removed copy plugin and its import (no longer needed) - Removed sourcemap: false (default behavior) Co-authored-by: hzhangxyz <[email protected]> * Remove @web/rollup-plugin-copy from devDependencies - Removed unused @web/rollup-plugin-copy package - Applied biome formatting fixes Co-authored-by: hzhangxyz <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hzhangxyz <[email protected]>
1 parent ec8dc8b commit 9c0a0f5

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
"types": "dist/tsds.d.mts",
1616
"files": [
1717
"dist/tsds.d.mts",
18-
"dist/ds.wasm",
19-
"dist/ds.wasm.map",
20-
"dist/tsds.mjs",
21-
"dist/tsds.mjs.map"
18+
"dist/tsds.mjs"
2219
],
2320
"scripts": {
24-
"emcc": "emcc -std=c++20 atsds/ds.cc src/*.cc -Iinclude -lembind -o atsds/ds.mjs --emit-tsd ds.d.mts -gsource-map=inline -O3 -ffast-math -flto -s ALLOW_MEMORY_GROWTH=1",
21+
"emcc": "emcc -std=c++20 atsds/ds.cc src/*.cc -Iinclude -lembind -o atsds/ds.mjs --emit-tsd ds.d.mts -O3 -ffast-math -flto -s ALLOW_MEMORY_GROWTH=1 -s SINGLE_FILE=1",
2522
"rollup": "rollup --config rollup.config.mjs",
2623
"build": "run-s emcc rollup",
2724
"test": "cross-env NODE_OPTIONS='$NODE_OPTIONS --experimental-vm-modules' jest --config=jest.config.mjs",
@@ -32,7 +29,6 @@
3229
"@rollup/plugin-terser": "^0.4.4",
3330
"@rollup/plugin-typescript": "^12.3.0",
3431
"@types/jest": "^30.0.0",
35-
"@web/rollup-plugin-copy": "^0.5.1",
3632
"cross-env": "^10.1.0",
3733
"jest": "^30.2.0",
3834
"npm-run-all": "^4.1.5",

rollup.config.mjs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import terser from "@rollup/plugin-terser";
22
import typescript from "@rollup/plugin-typescript";
33
import nodeResolve from "@rollup/plugin-node-resolve";
4-
import { copy } from "@web/rollup-plugin-copy";
54
import { dts } from "rollup-plugin-dts";
65

76
export default [
@@ -13,18 +12,9 @@ export default [
1312
output: {
1413
dir: "dist",
1514
format: "es",
16-
sourcemap: true,
1715
entryFileNames: "[name].mjs",
1816
},
19-
plugins: [
20-
terser(),
21-
typescript(),
22-
nodeResolve(),
23-
copy({
24-
patterns: ["ds.wasm", "ds.wasm.map"],
25-
rootDir: "atsds",
26-
}),
27-
],
17+
plugins: [terser(), typescript(), nodeResolve()],
2818
},
2919
{
3020
input: {

0 commit comments

Comments
 (0)