Skip to content

Commit

Permalink
Build CommonJs and ESM versions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkudera committed Jun 25, 2020
1 parent 8bdb28d commit 660d503
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"url": "git@github.com:davidkudera/google-maps-loader.git"
},
"license": "MIT",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"main": "./lib/cjs/index.js",
"types": "./lib/types/index.d.ts",
"module": "./lib/esm/index.js",
"dependencies": {
"@types/googlemaps": "^3.39.1"
},
"devDependencies": {
"@types/node": "^13.1.6",
"typescript": "^3.7.4"
"@types/node": "^14.0.14",
"typescript": "^3.9.5"
},
"scripts": {
"build": "tsc",
"watch": "tsc --watch"
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json"
}
}
7 changes: 7 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"outDir": "./lib/cjs"
}
}
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"target": "ES2017",
"module": "ES2020",
"sourceMap": true,
"declaration": true,
"outDir": "./lib"
"outDir": "./lib/esm",
"declarationDir": "./lib/types"
},
"include": [
"./src"
Expand Down

0 comments on commit 660d503

Please sign in to comment.