Skip to content

Commit

Permalink
[v7] Introduce Rollup to our tooling family
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Mar 22, 2021
1 parent 6a3b367 commit 63f3f39
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ yarn.lock
build/
packages/*/dist/
packages/*/esm/
packages/*/cjs/
coverage/
scratch/
*.pyc
*.tsbuildinfo

# TODO: Ignore for repo, but ship with bundles
*.d.ts

# logs
yarn-error.log
npm-debug.log
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
},
"devDependencies": {
"@google-cloud/storage": "^5.7.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-typescript": "^8.2.0",
"@size-limit/preset-small-lib": "^4.5.5",
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
"@types/chai": "^4.1.3",
Expand Down Expand Up @@ -56,6 +59,8 @@
"prettier": "^1.19.1",
"replace-in-file": "^4.0.0",
"rimraf": "^3.0.2",
"rollup": "^2.39.0",
"rollup-plugin-dts": "^2.0.1",
"sinon": "^7.3.2",
"size-limit": "^4.5.5",
"ts-jest": "26.5.1",
Expand Down
43 changes: 43 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import dts from 'rollup-plugin-dts';

export default [
{
input: 'src/index.ts',
output: {
dir: 'cjs',
format: 'cjs',
sourcemap: false,
},
plugins: [
resolve(),
commonjs(),
typescript({
declaration: false,
declarationMap: false,
inlineSources: false,
sourceMap: false,
}),
],
},
{
input: 'src/index.ts',
output: {
dir: 'esm',
format: 'esm',
sourcemap: false,
},
plugins: [
resolve(),
commonjs(),
typescript({ declaration: true, declarationDir: 'esm', inlineSources: false, sourceMap: false, rootDir: 'src' }),
],
},
{
input: './esm/index.d.ts',
output: [{ file: 'index.d.ts', format: 'esm' }],
plugins: [dts()],
},
];
16 changes: 16 additions & 0 deletions rollup.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';

export default {
input: 'src/index.ts',
output: {
dir: 'esm',
format: 'esm',
},
plugins: [
resolve(),
commonjs(),
typescript({ declaration: false, declarationMap: false, inlineSources: false, sourceMap: false }),
],
};
1 change: 1 addition & 0 deletions typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'**/*.js',
'**/dist/**/*',
'**/esm/**/*',
'**/cjs/**/*',
'**/build/**/*',
'**/packages/typescript/**/*',
'**/packages/eslint-*/**/*',
Expand Down

0 comments on commit 63f3f39

Please sign in to comment.