Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Engine Examples] - local build time gets progressively slower #5872

Closed
mvaligursky opened this issue Dec 1, 2023 · 1 comment · Fixed by #5873
Closed

[Engine Examples] - local build time gets progressively slower #5872

mvaligursky opened this issue Dec 1, 2023 · 1 comment · Fixed by #5873

Comments

@mvaligursky
Copy link
Contributor

I locally build examples using npm run develop, and then modify the source code of both the examples and the engine. I've noticed that the build time gets longer each build, forcing me to restart the command every 20 or so builds.

See how this progressed from 0.8s to 2.2s over about 15 builds:

Screenshot 2023-12-01 at 12 00 48

Note that I also run target=debug_es5 npm run watch in the engine to have up to date engine build, which might but might not be related.

pinging @kungfooman in case he has some ideas here.

@kungfooman
Copy link
Collaborator

Interesting, I can reproduce.

Saving random changes in engine only while running npm run develop always takes around ~300-500ms:

image

When I add run target=debug_es5 npm run watch in another shell the file watcher goes crazy:

image

Examples build script starts to even rebuild multiple times.

Pretty sure this can be fixed when we stop putting watchers on build outputs and instead use the rollup target configuration functions (e.g. function buildTarget(buildType, moduleFormat)) directly in examples/rollup.config.js for building these:

    { src: '../build/playcanvas.d.ts', dest: 'dist/playcanvas.d.ts' },
    { src: '../build/playcanvas.js', dest: 'dist/iframe/playcanvas.js' },
    { src: '../build/playcanvas.dbg.js', dest: 'dist/iframe/playcanvas.dbg.js' },
    { src: '../build/playcanvas.prf.js', dest: 'dist/iframe/playcanvas.prf.js' },
    { src: '../build/playcanvas-extras.js', dest: 'dist/iframe/playcanvas-extras.js' },

Another advantage is: we won't need npm run build in engine folder any longer (simplifying the build procedure a bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants