-
-
Notifications
You must be signed in to change notification settings - Fork 634
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
Refactor build -- 13x faster typescript bundling #1558
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
11dbb34
Rewrote build scripts for readability
jhsware 24dd7de
Fixed error function and feedback
jhsware ebf9f7f
Fixed output names
jhsware 62bd151
Only perform type generation once since it is done for the entire pro…
jhsware 7fecbc5
Bundle inferno-shared first because it has dependents. Stream feedbac…
jhsware 7e83cf2
We can use types generated by rollup
jhsware aa2b335
Missed setting production on umd prod build
jhsware b092bab
Allow partial builds and re-added quick-test scripts
jhsware e73a31c
Much faster build by transpiling typescript before bundling
jhsware dd7eb33
Use tmpDist as temporary folder instead
jhsware e274f03
show build size on build
jhsware 29716e4
Fixed quick-test scripts
jhsware 873a63d
Removed broken quick-test scripts.
jhsware 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
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
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,10 @@ | ||
const join = require('path').join; | ||
const cwd = process.cwd(); | ||
const pkgJSON = require(join(cwd, 'package.json')); | ||
const mergedirs = require('merge-dirs').default; | ||
|
||
if (pkgJSON.private) { | ||
return; | ||
} | ||
// Move type declaration files generated by TSC to dist folder | ||
mergedirs(join(cwd, '../../build/packages/', pkgJSON.name, 'src'), join(cwd, 'dist'), 'overwrite'); |
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
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
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.
I wonder if the alias plugin is needed anymore? Also would it be possible to build all packages using rollup inputs rather than spawning new process for each package using lerna?
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.
Interesting! I didn't investigate the alias plugin due to lack of time. I ran into an issue that I now realise might have been related to that plugin but it solved itself. If we can remove it we should because it makes the build process harder to understand.
I am not sure that I understand what you mean by "using rollup inputs". I chose to let
lerna exec
take care of parallel execution because I wanted to simplify everything to allow a lower barrier of entry for further optimisation. If esbuild solves const enums I believe the esm and esmnext parts of the transforms could be done using esbuild without making the build process more complex, that would cut build time to 2.5mins.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.
alias.js appears to be important to the build workflow. It allows packages to use transpiled output during bundling.