Browse Source

Update build config

Export declaration files from TypeScript.
tags/0.3.0
TheoryOfNekomata 4 years ago
parent
commit
f38b649632
4 changed files with 17 additions and 23 deletions
  1. +7
    -4
      .npmignore
  2. +6
    -3
      package.json
  3. +1
    -15
      rollup.config.js
  4. +3
    -1
      tsconfig.json

+ 7
- 4
.npmignore View File

@@ -1,14 +1,17 @@
.storybook/
coverage/ coverage/
docs/
lib/ lib/
plop/ plop/
utilities/ utilities/
.babelrc
.env .env
.env.example .env.example
lib/index.stories.ts
.editorconfig
.prettierrc
doczrc.js
global.d.ts
jest.config.js jest.config.js
jest.setup.ts jest.setup.ts
plopfile.js plopfile.js
rollup.config.js rollup.config.js
tsconfig.json
yarn.lock
**/*.test.d.ts

+ 6
- 3
package.json View File

@@ -2,8 +2,10 @@
"name": "@tesseract-design/react-common", "name": "@tesseract-design/react-common",
"version": "0.0.0", "version": "0.0.0",
"description": "Common front-end components for Web using the Tesseract design system, written in React.", "description": "Common front-end components for Web using the Tesseract design system, written in React.",
"main": "dist/bundle.cjs.js",
"module": "dist/bundle.esm.js",
"directories": {
"lib": "dist"
},
"main": "dist/index.js",
"repository": "https://code.modal.sh/tesseract-design/react-common.git", "repository": "https://code.modal.sh/tesseract-design/react-common.git",
"author": "TheoryOfNekomata <allan.crisostomo@outlook.com>", "author": "TheoryOfNekomata <allan.crisostomo@outlook.com>",
"license": "UNLICENSED", "license": "UNLICENSED",
@@ -50,5 +52,6 @@
"react-dom": "16.13.1", "react-dom": "16.13.1",
"react-feather": "2.0.3", "react-feather": "2.0.3",
"styled-components": "5.1.0" "styled-components": "5.1.0"
}
},
"homepage": "https://make.modal.sh/tesseract/web/react/common"
} }

+ 1
- 15
rollup.config.js View File

@@ -10,7 +10,7 @@ export default [
{ {
input: ENTRY_POINT, input: ENTRY_POINT,
output: { output: {
file: pkg.main,
dir: pkg.directories.lib,
format: 'cjs', format: 'cjs',
}, },
plugins: [ plugins: [
@@ -21,18 +21,4 @@ export default [
process.env.NODE_ENV === 'production' && terser(), process.env.NODE_ENV === 'production' && terser(),
], ],
}, },
{
input: ENTRY_POINT,
output: {
file: pkg.module,
format: 'esm',
},
plugins: [
peerDepsExternal({
includeDependencies: true,
}),
typescript(),
process.env.NODE_ENV === 'production' && terser(),
],
},
] ]

+ 3
- 1
tsconfig.json View File

@@ -17,7 +17,9 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"jsx": "react"
"jsx": "react",
"declaration": true,
"declarationDir": "./dist"
}, },
"exclude": [ "exclude": [
"node_modules" "node_modules"


Loading…
Cancel
Save