Skip to content

Commit

Permalink
Add CommonJS build target back. [#231]
Browse files Browse the repository at this point in the history
* emit the CommonJS build as index.cjs.
  • Loading branch information
bdon committed May 14, 2024
1 parent 5d30ba0 commit 8423fc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions styles/package-lock.json

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

10 changes: 7 additions & 3 deletions styles/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "protomaps-themes-base",
"version": "3.0.0",
"version": "3.1.0",
"description": "Protomaps basemap themes for MapLibre GL JS",
"type": "module",
"exports": "./dist/index.js",
"exports": {
"require":"./dist/index.cjs",
"default":"./dist/index.js"
},
"types": "dist/index.d.ts",
"source": "src/index.ts",
"files": [
Expand All @@ -13,6 +16,7 @@
"scripts": {
"build-iife": "esbuild src/index.ts --outfile=dist/protomaps-themes-base.js --target=es6 --global-name=protomaps_themes_base --bundle --format=iife",
"build-esm": "esbuild src/index.ts --outfile=dist/index.js --target=es6 --bundle --format=esm",
"build-cjs": "esbuild src/index.ts --outfile=dist/index.cjs --target=es6 --bundle --format=cjs",
"build-tsc": "tsc --declaration --emitDeclarationOnly --outdir dist",
"generate-layers": "tsx src/generate_layers.ts",
"dist-light": "mkdir -p dist/layers && npm run --silent generate-layers protomaps light > dist/layers/light.json",
Expand All @@ -21,7 +25,7 @@
"dist-grayscale": "mkdir -p dist/layers && npm run --silent generate-layers protomaps grayscale > dist/layers/grayscale.json",
"dist-black": "mkdir -p dist/layers && npm run --silent generate-layers protomaps black > dist/layers/black.json",
"dist-all": "npm run dist-light && npm run dist-dark && npm run dist-white && npm run dist-grayscale && npm run dist-black",
"build": "npm run build-iife && npm run build-esm && npm run build-tsc && npm run dist-all",
"build": "npm run build-iife && npm run build-esm && npm run build-cjs && npm run build-tsc && npm run dist-all",
"test": "tsx test/index.test.ts",
"tsc": "tsc --noEmit --watch",
"check": "biome check src test --javascript-formatter-indent-style=space --json-formatter-indent-style=space"
Expand Down

0 comments on commit 8423fc6

Please sign in to comment.