Skip to content

Commit

Permalink
trying to get the build working
Browse files Browse the repository at this point in the history
  • Loading branch information
toloudis committed Aug 24, 2024
1 parent ff0a529 commit 72def6b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prepare": "npm run build",
"build-docs": "node node_modules/documentation/bin/documentation.js build src/Histogram.ts src/View3d.ts src/Volume.ts src/VolumeMaker.ts src/VolumeLoader.ts -f html -o docs --shallow",
"build": "npm run transpileES && npm run build-types",
"vbuild": "vite build",
"vbuild": "vite build ./",
"build-types": "tsc -p tsconfig.types.json",
"build-demo": "webpack --config webpack.demo.js",
"clean": "rimraf es/",
Expand Down
11 changes: 8 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ export default defineConfig({
test: {
exclude: [...configDefaults.exclude, "es/test/*"],
},
worker: { format: "es" },
build: {
lib: { entry: resolve(__dirname, "src/index.ts"), formats: ["es"] },
lib: { entry: resolve(__dirname, "src/index.ts"), formats: ["es"], name: "@aics/volume-viewer" },
sourcemap: true,
rollupOptions: {
// treat all ts files as entry points so that they are translated preserving the directory structure
input: Object.fromEntries(
globSync("src/**/*.js").map((file) => [
globSync("src/**/*.ts", { ignore: ["src/test/**/*.ts", "node_modules"] }).map((file) => [
// This remove `src/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
path.relative("src", file.slice(0, file.length - path.extname(file).length)),
Expand All @@ -25,7 +28,9 @@ export default defineConfig({
),
output: {
format: "es",
dir: "dist",
dir: "es",
// treat all ts files as entry points so that they are translated preserving the directory structure
entryFileNames: "[name].js",
},
},
},
Expand Down

0 comments on commit 72def6b

Please sign in to comment.