-
-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(commonjs): throw for dynamic requires from outside the configure…
…d root (#1038)
- Loading branch information
1 parent
08ab82c
commit c198d9d
Showing
7 changed files
with
54 additions
and
15 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
3 changes: 0 additions & 3 deletions
3
packages/commonjs/test/fixtures/form/dynamic-template-literal/input.js
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
packages/commonjs/test/fixtures/form/dynamic-template-literal/output.js
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
packages/commonjs/test/fixtures/samples/dynamic-require-outside-root/main.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,6 @@ | ||
function takeModule(path) { | ||
// eslint-disable-next-line global-require,import/no-dynamic-require | ||
return require(path); | ||
} | ||
|
||
takeModule('./nested/target.js'); |
1 change: 1 addition & 0 deletions
1
packages/commonjs/test/fixtures/samples/dynamic-require-outside-root/nested/target.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 = 'target'; |
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