-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏎️ performance: optimize build performance (#2280)
- use loader resolution aliases - tweaks to default `build.*` values - babel done on `register` ## Type of change **PATCH: backwards compatible change**
- Loading branch information
1 parent
d98ecde
commit 360aa61
Showing
24 changed files
with
286 additions
and
158 deletions.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import type {Factory} from './index.js' | ||
|
||
export const externalsType: Factory<`externalsType`> = async app => `var` | ||
export const externalsType: Factory<`externalsType`> = async app => | ||
undefined |
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,4 +1,4 @@ | ||
import type {Factory} from './index.js' | ||
|
||
export const performance: Factory<`performance`> = async ({hooks}) => | ||
hooks.filter(`build.performance`, {hints: false}) | ||
hooks.filter(`build.performance`, false) |
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,4 +1,7 @@ | ||
import type {Factory} from './index.js' | ||
|
||
export const profile: Factory<`profile`> = async app => | ||
app.hooks.filter(`build.profile`, undefined) | ||
export const profile: Factory<`profile`> = async bud => | ||
bud.hooks.filter( | ||
`build.profile`, | ||
bud.isCLI() && bud.context.args[`debug`], | ||
) |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import type {Factory} from './index.js' | ||
|
||
export const resolveLoader: Factory<`resolveLoader`> = async bud => | ||
bud.hooks.filter(`build.resolveLoader`, { | ||
alias: {}, | ||
export const resolveLoader: Factory<`resolveLoader`> = async ({hooks}) => | ||
hooks.filter(`build.resolveLoader`, { | ||
alias: hooks.filter(`build.resolveLoader.alias`, {}), | ||
}) |
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,8 +1,25 @@ | ||
import type {Factory} from './index.js' | ||
|
||
export const snapshot: Factory<`snapshot`> = async app => | ||
app.hooks.filter(`build.snapshot`, { | ||
managedPaths: app.hooks.filter(`build.snapshot.managedPaths`, [ | ||
...new Set([app.path(`@modules`)]), | ||
export const snapshot: Factory<`snapshot`> = async ({env, hooks, path}) => | ||
hooks.filter(`build.snapshot`, { | ||
immutablePaths: hooks.filter(`build.snapshot.immutablePaths`, []), | ||
managedPaths: hooks.filter(`build.snapshot.managedPaths`, [ | ||
...new Set([path(`@modules`)]), | ||
]), | ||
buildDependencies: hooks.filter( | ||
`build.snapshot.buildDependencies`, | ||
env.isTrue(`CI`) ? {hash: true} : {timestamp: true}, | ||
), | ||
module: hooks.filter( | ||
`build.snapshot.module`, | ||
env.isTrue(`CI`) ? {hash: true} : {timestamp: true}, | ||
), | ||
resolve: hooks.filter( | ||
`build.snapshot.resolve`, | ||
env.isTrue(`CI`) ? {hash: true} : {timestamp: true}, | ||
), | ||
resolveBuildDependencies: hooks.filter( | ||
`build.snapshot.resolveBuildDependencies`, | ||
env.isTrue(`CI`) ? {hash: true} : {timestamp: true}, | ||
), | ||
}) |
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
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
Oops, something went wrong.