-
-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add
strict: true
to RawModule (#6755)
- Loading branch information
Showing
7 changed files
with
56 additions
and
0 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
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/ignore/concatenated-strict/ignored-module.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 @@ | ||
module.exports = "ignored"; |
13 changes: 13 additions & 0 deletions
13
packages/rspack-test-tools/tests/configCases/ignore/concatenated-strict/index.mjs
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,13 @@ | ||
/** @type {import('fs')} */ | ||
const fs = __non_webpack_require__("fs"); | ||
|
||
import ignored from "./ignored-module"; | ||
|
||
it("should startsWith use strict", function () { | ||
const source = fs.readFileSync(__filename, "utf-8"); | ||
expect(source.length).not.toBe(0); | ||
expect(ignored).toEqual({}); | ||
expect( | ||
source.startsWith('"use strict"') || source.startsWith("'use strict'") | ||
).toBeTruthy(); | ||
}); |
15 changes: 15 additions & 0 deletions
15
packages/rspack-test-tools/tests/configCases/ignore/concatenated-strict/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,15 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
entry: "./index.mjs", | ||
resolve: { | ||
alias: { | ||
"./ignored-module": false | ||
} | ||
}, | ||
output: { | ||
iife: false | ||
}, | ||
optimization: { | ||
concatenateModules: true | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/rspack-test-tools/tests/configCases/ignore/strict/ignored-module.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 @@ | ||
module.exports = "ignored"; |
13 changes: 13 additions & 0 deletions
13
packages/rspack-test-tools/tests/configCases/ignore/strict/index.mjs
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,13 @@ | ||
/** @type {import('fs')} */ | ||
const fs = __non_webpack_require__("fs"); | ||
|
||
import ignored from "./ignored-module"; | ||
|
||
it("should startsWith use strict", function () { | ||
const source = fs.readFileSync(__filename, "utf-8"); | ||
expect(source.length).not.toBe(0); | ||
expect(ignored).toEqual({}); | ||
expect( | ||
source.startsWith('"use strict"') || source.startsWith("'use strict'") | ||
).toBeTruthy(); | ||
}); |
12 changes: 12 additions & 0 deletions
12
packages/rspack-test-tools/tests/configCases/ignore/strict/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,12 @@ | ||
/** @type {import("@rspack/core").Configuration} */ | ||
module.exports = { | ||
entry: "./index.mjs", | ||
resolve: { | ||
alias: { | ||
"./ignored-module": false | ||
} | ||
}, | ||
output: { | ||
iife: false | ||
} | ||
}; |
34bb9ea
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
34bb9ea
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.
📝 Ran ecosystem CI: Open