Skip to content
This repository was archived by the owner on Jun 20, 2022. It is now read-only.

Commit ab8c033

Browse files
Ermakoygregberge
authored andcommitted
feat: add TypeScript definitions (#87)
1 parent 8d51dc0 commit ab8c033

File tree

6 files changed

+886
-1
lines changed

6 files changed

+886
-1
lines changed

config/rollup.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import resolve from 'rollup-plugin-node-resolve'
33
import babel from 'rollup-plugin-babel'
44
import replace from 'rollup-plugin-replace'
55
import commonjs from 'rollup-plugin-commonjs'
6+
import copy from 'rollup-plugin-cpy'
67
import { uglify } from 'rollup-plugin-uglify'
78

89
// eslint-disable-next-line
@@ -11,10 +12,20 @@ const babelConfig = require('../../.babelrc')
1112
export const getRollupConfig = ({ pkg, pwd, buildName }) => {
1213
const SOURCE_DIR = path.resolve(pwd, 'src')
1314
const DIST_DIR = path.resolve(pwd, 'dist')
15+
const CORE_DIR = path.resolve(pwd, '../shared/core');
1416

1517
const baseConfig = {
1618
input: `${SOURCE_DIR}/index.js`,
17-
plugins: [babel({ exclude: '**/node_modules/**', ...babelConfig })],
19+
plugins: [
20+
babel({
21+
"exclude": "**/node_modules/**",
22+
...babelConfig
23+
}),
24+
copy({
25+
"files": `${CORE_DIR}/*.d.ts`,
26+
"dest": DIST_DIR
27+
})
28+
],
1829
}
1930

2031
const esConfig = Object.assign({}, baseConfig, {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"remark-external-links": "^3.0.0",
6767
"rollup": "^0.66.6",
6868
"rollup-plugin-babel": "^4.0.3",
69+
"rollup-plugin-cpy": "^1.1.0",
6970
"rollup-plugin-commonjs": "^9.2.0",
7071
"rollup-plugin-node-resolve": "^3.4.0",
7172
"rollup-plugin-replace": "^2.1.0",

packages/core-em/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"main": "dist/smooth-ui-core-em.cjs.js",
1616
"module": "dist/smooth-ui-core-em.es.js",
1717
"jsnext:main": "dist/smooth-ui-core-em.es.js",
18+
"types": "dist/index.d.ts",
1819
"author": "Greg Bergé <berge.greg@gmail.com>",
1920
"license": "MIT",
2021
"scripts": {

packages/core-sc/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"main": "dist/smooth-ui-core-sc.cjs.js",
1515
"module": "dist/smooth-ui-core-sc.es.js",
1616
"jsnext:main": "dist/smooth-ui-core-sc.es.js",
17+
"types": "dist/index.d.ts",
1718
"author": "Greg Bergé <berge.greg@gmail.com>",
1819
"license": "MIT",
1920
"scripts": {

0 commit comments

Comments
 (0)