Skip to content

Commit

Permalink
fix(template-webpack): only use node-loader if the .node files are in…
Browse files Browse the repository at this point in the history
… native_modules/
  • Loading branch information
malept committed Aug 16, 2021
1 parent 5047f5b commit 9f2ef5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/template/typescript-webpack/tmpl/webpack.rules.js
Original file line number Diff line number Diff line change
@@ -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',
},
{
Expand Down
4 changes: 3 additions & 1 deletion packages/template/webpack/tmpl/webpack.rules.js
Original file line number Diff line number Diff line change
@@ -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',
},
{
Expand Down

0 comments on commit 9f2ef5a

Please # to comment.