Skip to content

Commit

Permalink
fix(examples/vite): fix vite example when using a real Neuroglancer i…
Browse files Browse the repository at this point in the history
…nstall

The vite examples previously worked only when using a symlinked
Neuroglancer (as in the tests used in this repo), but not when
the Neuroglancer dependency was installed normally.

The vite dev server special-cases symlinked dependencies in a way that
made its optimizeDeps step work when Neuroglancer is symlinked in
`node_modules` but not otherwise.

Additional optimizeDeps options have now been added to the vite example
configs to ensure the build works when Neuroglancer is installed as a
normal dependency.

Fixes #683
  • Loading branch information
jbms committed Dec 19, 2024
1 parent 2165343 commit 3d2f93d
Show file tree
Hide file tree
Showing 19 changed files with 186 additions and 1,851 deletions.
15 changes: 12 additions & 3 deletions build_tools/after-version-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@ await Promise.all(
await execFileAsync("npm", ["install", "--no-audit", "--no-fund"], {
cwd: exampleDir,
});
await execFileAsync("git", ["add", "package-lock.json"], {
cwd: exampleDir,
});
}),
);

await execFileAsync(
"git",
[
"add",
...(await glob("examples/*/*/package-lock.json", {
absolute: false,
cwd: rootDir,
})),
],
{ cwd: rootDir },
);
1 change: 1 addition & 0 deletions build_tools/build-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async function buildPackage(options: {
const { postpack } = packageJson["scripts"];
delete packageJson["scripts"];
packageJson["scripts"] = { postpack };
packageJson["files"] = ["lib/**/*"];
} else {
delete packageJson["private"];
packageJson["scripts"] = {};
Expand Down
1 change: 0 additions & 1 deletion examples/parcel/parcel-project-built/package-lock.json

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

Loading

0 comments on commit 3d2f93d

Please sign in to comment.