-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update Rollup config #4282
Update Rollup config #4282
Conversation
This PR means we now have 8 possible engine targets, since Do we want to build them all when invoking For application development I specifically want How do we go about adding all build targets to package.json? |
A simpler set of build targets to replace what we have now:
|
Another question, do we add the new output files to the npm package? (I think yes). |
it seems the simpler build targets build 2, 4 or 8 targets a time. I hope we still have one which builds a single target a time? |
Yes, we add the new output files to the NPM package.
|
The rollup script now handles the following values for
An invalid target will result nothing being built. |
Also added general watch script, which can be used to watch everything, a subset or a specific target. For example, to watch debug es6 build do:
The same holds for |
I'm not super familiar with this naming, I'd probably get confused. Is this really standard way of referring to es5 vs es6 output? |
|
Finally:
Sorry for the flurry of changes to the original PR. It is now ready for review. |
"build/playcanvas.dbg.js", | ||
"build/playcanvas.prf.js", | ||
"build/playcanvas.mjs", | ||
"build/playcanvas.min.mjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue we shouldn't ship this. Devs will use the module in their own build process which will do its own bundling/minification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree it might have limited usefulness, but is that reason enough to remove it from the package? For example couldn't users in future load the mjs from the browser directly, in which case the min version might be useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could load the module build directly from a script tag but I don't see that as being a common use case. I guess there's no major harm to including it. But I might suggest removing it in future. 😄
@slimbuck I have a feeling that this PR removed the optimization that would output both |
You are right. Release build always built both outputs. So now, if you're after a single target it'll build a little quicker. But if you're after both targets then it'll build slower. I've looked at the rollup code but haven't yet managed to figure out a straightforward way of accomplishing this. Will keep thinking. |
This PR replaces the specific build target configurations with a function which can construct the target config for any combination of build type (release, debug, profile, min) and module type (es5 and es6).
This means we can now generate profile, debug and minified es6 module builds too.
Also: