Skip to content

Commit

Permalink
fix: compile to ES modules
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Jul 20, 2020
1 parent 4fc6e77 commit edf7d70
Show file tree
Hide file tree
Showing 5 changed files with 718 additions and 668 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"author": "Connor Bär <[email protected]>",
"license": "Apache-2.0",
"private": false,
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
"types": "dist/es/index.d.ts",
"sideEffects": false,
"files": [
"dist",
Expand All @@ -23,7 +23,9 @@
"scripts": {
"start": "tsc --watch",
"dev": "yarn start",
"build": "tsc && tsc --project ./tsconfig-es.json",
"build": "yarn build:es && yarn build:cjs",
"build:es": "tsc",
"build:cjs": "tsc --project tsconfig.cjs.json",
"lint": "foundry run eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "yarn lint --fix",
"lint:ci": "yarn lint --format junit -o __reports__/junit/eslint-results.xml",
Expand Down
7 changes: 0 additions & 7 deletions tsconfig-es.json

This file was deleted.

8 changes: 8 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"target": "es5",
"outDir": "./dist/cjs"
}
}
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"target": "ES2017",
"module": "ES2020",
"lib": ["es2017", "es7", "es6", "dom"],
"declaration": true,
"strict": true,
Expand All @@ -11,7 +11,7 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"outDir": "./dist"
"outDir": "./dist/es"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**.spec.*"],
Expand Down
Loading

0 comments on commit edf7d70

Please sign in to comment.