diff --git a/packages/template/typescript-webpack/tmpl/webpack.rules.js b/packages/template/typescript-webpack/tmpl/webpack.rules.js index 8069b8e3dd..e85ade6592 100644 --- a/packages/template/typescript-webpack/tmpl/webpack.rules.js +++ b/packages/template/typescript-webpack/tmpl/webpack.rules.js @@ -1,7 +1,9 @@ module.exports = [ // Add support for native node modules { - test: /\.node$/, + // We're specifying native_modules in the test because the asset relocator loader generates a + // "fake" .node file which is really a cjs file. + test: /native_modules\/.+\.node$/, use: 'node-loader', }, { diff --git a/packages/template/webpack/tmpl/webpack.rules.js b/packages/template/webpack/tmpl/webpack.rules.js index 219bb313e7..66bc18f941 100644 --- a/packages/template/webpack/tmpl/webpack.rules.js +++ b/packages/template/webpack/tmpl/webpack.rules.js @@ -1,7 +1,9 @@ module.exports = [ // Add support for native node modules { - test: /\.node$/, + // We're specifying native_modules in the test because the asset relocator loader generates a + // "fake" .node file which is really a cjs file. + test: /native_modules\/.+\.node$/, use: 'node-loader', }, {