-
-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: alias sequence order & merge result (#9206)
- Loading branch information
Showing
14 changed files
with
133 additions
and
47 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
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/compilation/entrypoints/bar.js
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 @@ | ||
Math.random(); |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/compilation/entrypoints/foo.js
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 @@ | ||
Math.random(); |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/compilation/entrypoints/index.js
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 @@ | ||
Math.random(); |
36 changes: 36 additions & 0 deletions
36
packages/rspack-test-tools/tests/configCases/compilation/entrypoints/rspack.config.js
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,36 @@ | ||
const PLUGIN_NAME = "plugin"; | ||
|
||
class Plugin { | ||
/** | ||
* @param {import("@rspack/core").Compiler} compiler | ||
*/ | ||
apply(compiler) { | ||
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => { | ||
compilation.hooks.finishModules.tap(PLUGIN_NAME, () => { | ||
expect(Array.from(compilation.entrypoints.keys())).toEqual([]); | ||
}); | ||
|
||
compilation.hooks.afterProcessAssets.tap(PLUGIN_NAME, () => { | ||
expect(Array.from(compilation.entrypoints.keys())).toEqual(["main", "foo", "bar"]); | ||
}) | ||
}); | ||
} | ||
} | ||
|
||
/**@type {import("@rspack/core").Configuration}*/ | ||
module.exports = { | ||
entry: { | ||
main: { | ||
import: "./index.js", | ||
}, | ||
foo: { | ||
import: "./foo.js", | ||
asyncChunks: true | ||
}, | ||
bar: { | ||
import: "./bar.js", | ||
asyncChunks: true | ||
}, | ||
}, | ||
plugins: [new Plugin()] | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/module/alias-sequence-merge/exist.js
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 @@ | ||
export const foo = "foo"; |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/module/alias-sequence-merge/index.js
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 @@ | ||
require("foo"); |
23 changes: 23 additions & 0 deletions
23
packages/rspack-test-tools/tests/configCases/module/alias-sequence-merge/rspack.config.js
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,23 @@ | ||
/** | ||
* @type {import('@rspack/core').RspackOptions} | ||
*/ | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
resolve: { | ||
alias: { | ||
"foo": "./not-exist" | ||
} | ||
}, | ||
}, | ||
{ | ||
resolve: { | ||
alias: { | ||
"foo": "./exist" | ||
} | ||
}, | ||
}, | ||
] | ||
}, | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/module/alias-sequence-order/exist.js
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 @@ | ||
export const foo = "foo"; |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/module/alias-sequence-order/index.js
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 @@ | ||
require("foo/bar"); |
23 changes: 23 additions & 0 deletions
23
packages/rspack-test-tools/tests/configCases/module/alias-sequence-order/rspack.config.js
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,23 @@ | ||
/** | ||
* @type {import('@rspack/core').RspackOptions} | ||
*/ | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
resolve: { | ||
alias: { | ||
"foo/bar": "./exist" | ||
} | ||
}, | ||
}, | ||
{ | ||
resolve: { | ||
alias: { | ||
"foo": "./not-exist" | ||
} | ||
}, | ||
}, | ||
] | ||
}, | ||
}; |
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
a2132dc
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.
📝 Benchmark detail: Open
a2132dc
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.
📝 Ecosystem CI detail: Open