Skip to content

Commit

Permalink
Merge pull request #62 from camptocamp/fix-typings-build
Browse files Browse the repository at this point in the history
Keep d.ts files in package
  • Loading branch information
jahow authored Jul 24, 2024
2 parents 1b48d46 + 4c08e9f commit 5a57e0e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A pure JS library for interacting with geospatial services.",
"main": "./dist/dist-node.js",
"browser": "./dist/index.js",
"typings": "./src/index.ts",
"typings": "./dist/index.d.ts",
"repository": "https://github.com/camptocamp/ogc-client",
"homepage": "https://github.com/camptocamp/ogc-client",
"files": [
Expand Down Expand Up @@ -60,7 +60,7 @@
"format:check": "prettier --check .",
"lint": "eslint src/**/*.ts",
"lint:fix": "npm run lint -- --fix",
"build": "npm run build:worker && npm run build:node && npm run build:browser",
"build": "rm -rf dist && npm run build:worker && npm run build:node && npm run build:browser",
"build:browser": "esbuild $(find ./src -name \"*.ts\" -type f -not -path '*worker/index.ts' -not -path '*.spec.ts') --outdir=./dist --platform=neutral --format=esm --sourcemap",
"build:node": "vite build --config vite.node-config.js",
"build:worker": "vite build --config vite.worker-config.js",
Expand Down
1 change: 1 addition & 0 deletions vite.node-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineConfig({
globals: (name) => name,
},
},
emptyOutDir: false,
outDir: 'dist',
minify: false,
},
Expand Down
3 changes: 3 additions & 0 deletions vite.worker-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import dts from 'vite-plugin-dts';

export default defineConfig({
plugins: [
// note: this will generate d.ts files for all the library
dts({
include: ['./src/**/*'],
exclude: ['./src/**/*.spec.ts'],
}),
],
build: {
Expand All @@ -13,6 +15,7 @@ export default defineConfig({
formats: ['es'],
fileName: `worker/index`,
},
emptyOutDir: false,
rollupOptions: {
external: [/^ol/, 'proj4'],
output: {
Expand Down

0 comments on commit 5a57e0e

Please sign in to comment.