-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(concatenate): ignored module should be treated as external (#1149)
* fix: 🐛 use empty string for ignored module * fix: 🐛 flag ignored module and it should be treat as external * test: ✅ add ignored module in concatenation * refactor: 🎨
- Loading branch information
1 parent
c10d80b
commit 4a0f2ad
Showing
9 changed files
with
49 additions
and
6 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
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 @@ | ||
const { | ||
injectSimpleJest, | ||
parseBuildResult, | ||
moduleDefinitionOf, | ||
} = require("../../../scripts/test-utils"); | ||
const { files } = parseBuildResult(__dirname); | ||
injectSimpleJest(); | ||
|
||
// ignored module should not be concatenated, so keep the definition | ||
expect(files["index.js"]).toContain(moduleDefinitionOf("node_modules/pkg/index.js")); | ||
|
||
require("./dist/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,9 @@ | ||
import {ans} from "./inner"; | ||
import ignoredDefault, {ignoredNamed} from "pkg" | ||
|
||
it("should have the correct values", function() { | ||
expect(ignoredDefault).toStrictEqual({}); | ||
expect(ignoredNamed).toBe(undefined); | ||
expect(ans).toBe(42) | ||
}); | ||
|
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 ans = 42 |
9 changes: 9 additions & 0 deletions
9
e2e/fixtures/mako.scope-hoisting.ignored-module/mako.config.json
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,9 @@ | ||
{ | ||
"entry": { | ||
"index": "./index.js" | ||
}, | ||
"optimization": { | ||
"skipModules": true, | ||
"concatenateModules": true | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
e2e/fixtures/mako.scope-hoisting.ignored-module/node_modules/pkg/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
e2e/fixtures/mako.scope-hoisting.ignored-module/node_modules/pkg/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.