Skip to content

Commit 1833306

Browse files
azuCopilot
andauthored
fix(script-compiler): add "mainFields" resolution to fix module parsing issue (#110)
* fix(script-compiler): add "mainFields" resolution * Update packages/@textlint/script-compiler/src/compiler.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6862363 commit 1833306

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/@textlint/script-compiler/src/compiler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ export const createWebpackConfig = ({
120120
resolve: {
121121
fallback: {
122122
fs: false
123-
}
123+
},
124+
// "module" field should be ignored
125+
// type=commonjs and "module" field is not compatible
126+
mainFields: ["browser", "main"]
124127
},
125128
performance: {
126129
hints: false

0 commit comments

Comments
 (0)