generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: extension build with pnpm is missing node_modules
node_modules folder contains external dependencies that cannot be included due to vite limitation. Signed-off-by: Denis Golovin <[email protected]>
- Loading branch information
Showing
2 changed files
with
31 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,30 +45,38 @@ if (fs.existsSync(builtinDirectory)) { | |
} | ||
|
||
// install external modules into dist folder | ||
cproc.exec('pnpm add [email protected]', { cwd: './dist' }, (error, stdout, stderr) => { | ||
cproc.exec('pnpm init', { cwd: './dist' }, (error, stdout, stderr) => { | ||
if (error) { | ||
console.log(stdout); | ||
console.log(stderr); | ||
throw error; | ||
} | ||
|
||
byline(fileStream) | ||
.on('data', line => { | ||
line.startsWith('!') ? excludedFiles.push(line.substring(1)) : includedFiles.push(line); | ||
}) | ||
.on('error', () => { | ||
throw new Error('Error reading .extfiles'); | ||
}) | ||
.on('end', () => { | ||
includedFiles.push(zipDirectory); // add destination dir | ||
mkdirp.sync(zipDirectory); | ||
console.log(`Copying files to ${zipDirectory}`); | ||
cp(includedFiles, { exclude: excludedFiles }, error => { | ||
if (error) { | ||
throw new Error('Error copying files', error); | ||
} | ||
console.log(`Zipping files to ${destFile}`); | ||
zipper.sync.zip(zipDirectory).compress().save(destFile); | ||
cproc.exec('pnpm install [email protected]', { cwd: './dist' }, (error, stdout, stderr) => { | ||
if (error) { | ||
console.log(stdout); | ||
console.log(stderr); | ||
throw error; | ||
} | ||
|
||
byline(fileStream) | ||
.on('data', line => { | ||
line.startsWith('!') ? excludedFiles.push(line.substring(1)) : includedFiles.push(line); | ||
}) | ||
.on('error', () => { | ||
throw new Error('Error reading .extfiles'); | ||
}) | ||
.on('end', () => { | ||
includedFiles.push(zipDirectory); // add destination dir | ||
mkdirp.sync(zipDirectory); | ||
console.log(`Copying ${includedFiles} to ${zipDirectory}`); | ||
cp(includedFiles, { exclude: excludedFiles }, error => { | ||
if (error) { | ||
throw new Error('Error copying files', error); | ||
} | ||
console.log(`Zipping files to ${destFile}`); | ||
zipper.sync.zip(zipDirectory).compress().save(destFile); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |