Skip to content

Commit

Permalink
chore(configs): add CJS output
Browse files Browse the repository at this point in the history
tech/compile-jsx
  • Loading branch information
connor-baer committed May 29, 2020
1 parent 79603d9 commit d9b87d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"sideEffects": false,
"version": "0.0.0-semantically-released",
"description": "SumUp's React UI component library",
"main": "dist/index.js",
"module": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/es/index.js",
"files": [
"dist",
"README.md"
Expand All @@ -13,7 +13,7 @@
"commit": "git-cz",
"start": "start-storybook -p 6006 -s .storybook/public",
"dev": "tsc --watch",
"build": "tsc",
"build": "tsc && tsc --project tsconfig.cjs.json",
"create:component": "foundry run plop component",
"static-styles": "cross-env BABEL_ENV=static babel-node --extensions '.js,.ts,.tsx' ./scripts/static-styles/cli.js",
"build:docs": "yarn build:storybook && yarn build:stylesheets",
Expand Down
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"
}
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["dom", "dom.iterable", "es2017"],
"module": "ES2020",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./dist",
"outDir": "./dist/cjs",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
Expand Down

0 comments on commit d9b87d0

Please sign in to comment.