Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1291,26 +1291,6 @@ export default async function analyze(
return;
}
if (wildcardIndex !== -1 && stats.isFile()) return;
// do not emit assets outside the package boundary if inside node_modules
if (pkgBase) {
const nodeModulesBase =
id.substring(0, id.indexOf(path.sep + 'node_modules')) +
path.sep +
'node_modules' +
path.sep;
if (!assetPath.startsWith(nodeModulesBase)) {
if (job.log)
console.log(
'Skipping asset emission of ' +
assetPath +
' for ' +
id +
' as it is outside the package base ' +
pkgBase,
);
return;
}
}
if (stats.isFile()) {
// do not emit file assets outside job.base
if (job.ignoreFn(path.relative(job.base, assetPath))) return;
Expand Down
1 change: 1 addition & 0 deletions test/unit/env-file-from-pkg/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MY_SECRET=value
1 change: 1 addition & 0 deletions test/unit/env-file-from-pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!node_modules
1 change: 1 addition & 0 deletions test/unit/env-file-from-pkg/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('some-pkg');
4 changes: 4 additions & 0 deletions test/unit/env-file-from-pkg/node_modules/some-pkg/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions test/unit/env-file-from-pkg/output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
"package.json",
"test/unit/env-file-from-pkg/.env",
"test/unit/env-file-from-pkg/input.js",
"test/unit/env-file-from-pkg/node_modules/some-pkg/index.js",
"test/unit/env-file-from-pkg/node_modules/some-pkg/package.json"
]