Skip to content

Commit

Permalink
Use rollup to copy files over (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhosseindhv authored May 16, 2020
1 parent bdc9ad0 commit 1aa7f0b
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 1 deletion.
251 changes: 251 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"type": "git"
},
"scripts": {
"build": "tsdx build --entry ./src/index.js && cp src/index.d.ts dist/index.d.ts",
"build": "tsdx build --entry ./src/index.js",
"prebuild": "npm run docs",
"prepublishOnly": "npm run build",
"docs": "rimraf typedoc.json && typedoc --tsconfig",
Expand Down Expand Up @@ -47,6 +47,7 @@
"react-dom": "^16.8.0",
"rimraf": "^3.0.2",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-copy": "^3.3.0",
"tsdx": "^0.13.2",
"typedoc": "^0.16.11",
"typescript": "^3.8.3"
Expand Down
3 changes: 3 additions & 0 deletions tsdx.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const copy = require('rollup-plugin-copy');
const bundleSize = require('rollup-plugin-bundle-size');

module.exports = {
rollup(config) {
config.plugins.push(bundleSize());
// copy decleration file over
config.plugins.push(copy({ targets: [{ src: 'src/index.d.ts', dest: 'dist' }] }));
return config;
},
};

0 comments on commit 1aa7f0b

Please sign in to comment.