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.
This commit is contained in:
Koen Vlaswinkel
2023-03-08 16:18:55 +01:00
parent 56111b39fc
commit d151b2f5f9
2 changed files with 1 additions and 6 deletions

View File

@@ -93,12 +93,6 @@ export async function deployPackage(
);
await copyPackage(sourcePath, distPath);
// This is necessary for vsce to know the dependencies
await copyDirectory(
resolve(sourcePath, "node_modules"),
resolve(distPath, "node_modules"),
);
return {
distPath,
name: packageJson.name,

View File

@@ -17,6 +17,7 @@ export async function packageExtension(): Promise<void> {
"..",
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
),
"--no-dependencies",
];
const proc = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
cwd: deployedPackage.distPath,