Skip to content

Compile embind to single file without source maps - #85

Merged
hzhangxyz merged 4 commits into
mainfrom
copilot/compile-embind-as-single-file
Dec 9, 2025
Merged

Compile embind to single file without source maps#85
hzhangxyz merged 4 commits into
mainfrom
copilot/compile-embind-as-single-file

Conversation

Copilot AI commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Plan: Compile embind to a single file and skip generating source map

  • Modify package.json to add -s SINGLE_FILE=1 to emcc command
  • Remove -gsource-map=inline from emcc command in package.json
  • Remove source map files from package.json files array
  • Disable sourcemap generation in rollup.config.mjs
  • Remove ds.wasm.map from copy patterns in rollup.config.mjs
  • Remove ds.wasm from files array (not generated with SINGLE_FILE=1)
  • Remove copy plugin entirely from rollup config
  • Remove explicit sourcemap: false (default behavior)
  • Remove @web/rollup-plugin-copy from devDependencies
  • Run pre-commit formatting checks

Changes Made

package.json

  1. Added -s SINGLE_FILE=1 to the emcc command to compile to a single file
  2. Removed -gsource-map=inline flag from emcc command
  3. Removed all source map files from the files array
  4. Removed dist/ds.wasm from files array since it's embedded in the JS file with SINGLE_FILE=1
  5. Removed @web/rollup-plugin-copy from devDependencies (no longer used)

rollup.config.mjs

  1. Removed the copy plugin import and usage (no longer needed since ds.wasm is embedded)
  2. Removed explicit sourcemap: false since it's the default behavior
  3. Applied biome formatting to plugins array
Original prompt

This section details on the original issue you should resolve

<issue_title>Compile embind to a single file and skip generating source map.</issue_title>
<issue_description>我们希望编译出来的是单个文件, 这样会让source map功能失效, 所以, 就这么办吧.

需要在package.json中修改, 比如emcc需要加上-s SINGLE_FILE=1 ,并去掉source map的功能.
然后包括package.json和rollup的配置都需要将source map的功能去掉.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@hzhangxyz
hzhangxyz marked this pull request as ready for review December 9, 2025 11:49
Copilot AI review requested due to automatic review settings December 9, 2025 11:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- 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 <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Compile embind to a single file and remove source map Compile embind to single file without source maps Dec 9, 2025
Copilot AI requested a review from hzhangxyz December 9, 2025 11:52
@hzhangxyz

Copy link
Copy Markdown
Member

@copilot ds.wasm 不再生成了, 需要去掉. copy这个plugin不需要了, 需要去掉. sourcemap: false是默认行为, 直接去掉就行.

…urcemap 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 <11623447+hzhangxyz@users.noreply.github.com>

Copilot AI commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

@copilot ds.wasm 不再生成了, 需要去掉. copy这个plugin不需要了, 需要去掉. sourcemap: false是默认行为, 直接去掉就行.

Done in e555332. Removed ds.wasm from files array, removed the copy plugin entirely, and removed the explicit sourcemap: false setting.

@hzhangxyz

Copy link
Copy Markdown
Member

package.json 中 的 @web/rollup-plugin-copy 要删掉. @copilot

- Removed unused @web/rollup-plugin-copy package
- Applied biome formatting fixes

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>

Copilot AI commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

package.json 中 的 @web/rollup-plugin-copy 要删掉. @copilot

Done in 31a7fec. Removed @web/rollup-plugin-copy from devDependencies and applied pre-commit formatting fixes.

@hzhangxyz
hzhangxyz merged commit 9c0a0f5 into main Dec 9, 2025
88 checks passed
Copilot AI requested a review from hzhangxyz December 9, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile embind to a single file and skip generating source map.

3 participants