-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bundling via esbuild. #30
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9b7a6ea
Initial pass at getting bundling working with esbuild.
dbreese 221a14b
WIP - removed --minifiy from esbuild cmd.
dbreese 921cf09
Rebasing and updating location of html files.
dbreese 1df8a11
Adding --minify
dbreese 02bdaf6
Updating to remove internal artifacts.
dbreese 47073aa
Fixing compile issue by backing out updates to package-lock.
dbreese b60ef7e
Added clean step.
dbreese 162392f
Adding --sourcemap and ignores.
dbreese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ node_modules | |
coverage/ | ||
.nyc_output/ | ||
.DS_Store | ||
extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
src/**/*.ts | ||
src/** | ||
.gitignore | ||
.yarnrc | ||
vsc-extension-quickstart.md | ||
**/tsconfig.json | ||
**/.eslintrc.json | ||
**/*.map | ||
**/*.ts | ||
CODEOWNERS | ||
RELEASE.md | ||
coverage/ | ||
.nyc_output/ | ||
.github | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Instructions to package this as an extension (*.vsix) file: | ||
|
||
1. Install vsce | ||
|
||
``` | ||
npm install -g @vscode/vsce | ||
``` | ||
|
||
2. Install dependencies | ||
|
||
NOTE: The packaging steps prunes the node_modules tree, so running `npm install` will reinstall dev dependencies. | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
3. Create package | ||
|
||
``` | ||
vsce package | ||
``` | ||
|
||
4. Manually install the generated .vsix file and smoke test. | ||
|
||
TODO: Eventually we can sign and publish it directly to marketplace. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need to do this with folders like
out/
andnode_modules/
too. There should be a very lightweight, file-count-wise, package at the end of the line, because everything is meant to be bundled into one file.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.
If I remove node_modules, the generated extension does not work. Also, the out is needed because that is where our extension is compiled to, which is our entrypoint. I dont think we can discard these two dirs.
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.
Did some more testing just to validate what I recalled from last week ;) :
main
in package.json defines it as/out/extension.js
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'm basically fiddling around in my environment, seeing similar things.
There's a gap of documentation about some of the entries in your standard
package.json
file vs. whatesbuild
is / might be expecting. For example, I switched locally to have esbuild use an--outfile
value ofdist/main.js
just to see how it went. And while it generates an all-in-onedist/main.js
, it still complains at runtime about trying to useout/extension.js
, which is themain
entry point inpackage.json
.The dearth of comprehensive documentation is...frustrating. I'm going to keep poking around.
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.
if you just change
--outfile
toout/extension.js
it should work though so that it matches package.json'smain
value?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 but I didn't like that because that's where we compile everything out too, and so you have to do a bunch of filtering to not include a swathe of JS files down there.
Locally, I ended up specifying
--outfile
asdist/main.js
, and made that mymain
target in package.json too, and that got past that particular hurdle (and onto another one, but that's another story).