Skip to content

Commit 83f70a8

Browse files
committed
fix(*): handle no node_modules directory
1 parent 424fe49 commit 83f70a8

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Diff for: .npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@univapaycast:registry=https://npm.pkg.github.com/

Diff for: src/index.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,14 @@ export class TypeScriptPlugin {
195195
fs.unlinkSync(outModulesPath)
196196
}
197197

198-
fs.copySync(
199-
path.resolve('node_modules'),
200-
path.resolve(path.join(BUILD_FOLDER, 'node_modules'))
201-
)
198+
if (fs.existsSync(path.resolve('node_modules'))) {
199+
fs.copySync(
200+
path.resolve('node_modules'),
201+
outModulesPath
202+
)
203+
} else {
204+
fs.mkdirpSync(outModulesPath)
205+
}
202206
} else {
203207
if (!fs.existsSync(outModulesPath)) {
204208
await this.linkOrCopy(path.resolve('node_modules'), outModulesPath, 'junction')

0 commit comments

Comments
 (0)