-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing bugs exposed by the tests!
- Loading branch information
Showing
16 changed files
with
73 additions
and
691 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
342 changes: 0 additions & 342 deletions
342
test/__snapshots__/ConfigCacheTestCases.longtest.js.snap
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default "a"; |
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 default "b"; |
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 default "c"; |
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 @@ | ||
export default "a"; |
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,3 @@ | ||
import * as shared from './shared'; | ||
console.log(shared); | ||
export default "b"; |
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,3 @@ | ||
import * as shared from './shared'; | ||
console.log(shared); | ||
export default "b"; |
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 default "c"; |
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 default "d"; |
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,31 @@ | ||
it("should set fetchPriority", () => { | ||
// Single Chunk | ||
import(/* webpackFetchPriority: "high" */ "./a"); | ||
expect(document.head._children).toHaveLength(1); | ||
const script1 = document.head._children[0]; | ||
expect(script1._attributes.fetchpriority).toBe("high"); | ||
|
||
// Multiple Chunks | ||
import(/* webpackFetchPriority: "high" */ "./b"); | ||
import(/* webpackFetchPriority: "high" */ "./b2"); | ||
expect(document.head._children).toHaveLength(4); | ||
const script2 = document.head._children[1]; | ||
const script3 = document.head._children[2]; | ||
const script4 = document.head._children[3]; | ||
expect(script2._attributes.fetchpriority).toBe("high"); | ||
expect(script3._attributes.fetchpriority).toBe("high"); | ||
expect(script4._attributes.fetchpriority).toBe("high"); | ||
|
||
// Single Chunk, low | ||
import(/* webpackFetchPriority: "low" */ "./c"); | ||
expect(document.head._children).toHaveLength(5); | ||
const script5 = document.head._children[4]; | ||
expect(script5._attributes.fetchpriority).toBe("low"); | ||
|
||
// Single Chunk, auto | ||
import(/* webpackFetchPriority: "auto" */ "./d"); | ||
expect(document.head._children).toHaveLength(6); | ||
const script6 = document.head._children[5]; | ||
expect(script6._attributes.fetchpriority).toBe("auto"); | ||
|
||
}) |
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 default "shared"; |
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,14 @@ | ||
/** @type {import("../../../../").Configuration} */ | ||
module.exports = { | ||
target: "web", | ||
output: { | ||
chunkFilename: "[name].js", | ||
crossOriginLoading: "anonymous" | ||
}, | ||
optimization: { | ||
minimize: false, | ||
splitChunks: { | ||
minSize: 1 | ||
} | ||
} | ||
}; |