Skip to content

Commit

Permalink
fix(script-compiler): support node: prefix
Browse files Browse the repository at this point in the history
It just remove node: prefix from importing
  • Loading branch information
azu committed Apr 3, 2024
1 parent 668112f commit c3d05ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@textlint/script-compiler/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export const createWebpackConfig = ({
new webpack.BannerPlugin({
banner: `textlinteditor:@@@ ${JSON.stringify(metadata)} @@@`
}),
// Remove the `node:` prefix
// see: https://github.com/webpack/webpack/issues/14166
new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => {
resource.request = resource.request.replace(/^node:/, "");
}),
// Node.js polyfill
new NodePolyfillPlugin({})
],
Expand Down

0 comments on commit c3d05ca

Please sign in to comment.