Skip to content

Commit d151b2f

Browse files
committed
Do not copy node_modules when packaging
We are no longer including our dependencies in the VSIX package, so we can tell VSCE that we don't want it to look at dependencies using `--no-dependencies`. If we do this, VSCE doesn't require the `node_modules` directory anymore and we can skip that step, which will make building significantly faster. I've confirmed that there are no changes between the two options by building the extension both without and with the change. This is the diff of the two outputs (using `diff -r`): ```diff diff --color -r vscode-codeql-1.8.0-dev.2023.3.8.15.10.13/extension/package.json vscode-codeql-old/extension/package.json 7c7 < "version": "1.8.0-dev.2023.3.8.15.10.13", --- > "version": "1.8.0-dev.2023.3.8.15.6.51", diff --color -r vscode-codeql-1.8.0-dev.2023.3.8.15.10.13/extension.vsixmanifest vscode-codeql-old/extension.vsixmanifest 4c4 < <Identity Language="en-US" Id="vscode-codeql" Version="1.8.0-dev.2023.3.8.15.10.13" Publisher="GitHub" /> --- > <Identity Language="en-US" Id="vscode-codeql" Version="1.8.0-dev.2023.3.8.15.6.51" Publisher="GitHub" /> ``` The only difference is the version number, which is expected.
1 parent 56111b3 commit d151b2f

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

extensions/ql-vscode/gulpfile.ts/deploy.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ export async function deployPackage(
9393
);
9494
await copyPackage(sourcePath, distPath);
9595

96-
// This is necessary for vsce to know the dependencies
97-
await copyDirectory(
98-
resolve(sourcePath, "node_modules"),
99-
resolve(distPath, "node_modules"),
100-
);
101-
10296
return {
10397
distPath,
10498
name: packageJson.name,

extensions/ql-vscode/gulpfile.ts/package.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export async function packageExtension(): Promise<void> {
1717
"..",
1818
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
1919
),
20+
"--no-dependencies",
2021
];
2122
const proc = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
2223
cwd: deployedPackage.distPath,

0 commit comments

Comments
 (0)