Skip to content

Add initial example of using esbuild#44

Open
garrettjstevens wants to merge 1 commit intomainfrom
esbuild_initial
Open

Add initial example of using esbuild#44
garrettjstevens wants to merge 1 commit intomainfrom
esbuild_initial

Conversation

@garrettjstevens
Copy link
Copy Markdown
Collaborator

From pairing with @cmdcolin today.

For the simple template plugin, using esbuild seems to work just fine. This needs to be tested with more types of pluggable elements and generalized (e.g. don't hardcode globalName in the build file).

Initial results show that building a single development mode output file using template takes 2.39s for rollup and 0.09s for esbuild.

With this build file, esbuild will also watch and rebuild files as well as serve the output.

Example:

$ yarn node esbuild.mjs 
yarn node v1.22.19
Serving at http://localhost:9000
Watching files...
Built in 8 ms with 0 error(s) and 0 warning(s)
Wrote 5.17 kB to dist/out.js
...
Built in 15 ms with 0 error(s) and 0 warning(s)
Wrote 5.17 kB to dist/out.js

Resolves #43

@cmdcolin
Copy link
Copy Markdown
Contributor

can confirm this example also works with the proteinview3d. do you think this example would be good to have in a separate repo or integrated here? i sometimes like the idea of having a variety of setups

@garrettjstevens
Copy link
Copy Markdown
Collaborator Author

I like the idea of having a couple different options, although it might be good to think about how we want to keep the code in src synchronized if we have multiple repos.

Also, the esbuild option here only produces a web bundle, it doesn't produce something that could be published to and installed from NPM by an app using the embedded components.

@cmdcolin
Copy link
Copy Markdown
Contributor

random data point: i have been using the esbuild setup with some good success in the msaview and proteinview plugins. turns out, the rollup production build is like, 4% and 2% larger respectively for both.

this almost makes me question a little bit whether it's worth spending extensive time on the rollup config, as much as i love even small bundle size savings, as i was even unable to use jbrowse-development-tools rollup config to compile nullish coalescing (i believe that is what i observed at least in GMOD/jbrowse-plugin-msaview#36)

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.

Add example of using esbuild

2 participants