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/ (#2449)
  • Loading branch information
malept authored Aug 16, 2021
1 parent 5047f5b commit bd2526b
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 bd2526b

Please sign in to comment.