Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
1,565 additions
and
1,870 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,3 @@ cache: | |
- /home/travis/.dts/typescript-installs/ | ||
script: | ||
- 'yarn test' | ||
- 'yarn dtslint' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,42 @@ | ||
import babel from 'rollup-plugin-babel' | ||
import pkg from './package.json' | ||
const babel = require('rollup-plugin-babel') | ||
const resolve = require('rollup-plugin-node-resolve') | ||
const commonjs = require('rollup-plugin-commonjs') | ||
|
||
export default { | ||
input: './src/index.js', | ||
output: [{ file: pkg.main, format: 'cjs' }, { file: pkg.module, format: 'es' }], | ||
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})], | ||
plugins: [babel()] | ||
} | ||
const extensions = ['.js', '.jsx', '.ts'] | ||
|
||
const getBabelOptions = ({ useESModules }, targets) => ({ | ||
babelrc: false, | ||
comments: false, | ||
extensions, | ||
exclude: '**/node_modules/**', | ||
runtimeHelpers: true, | ||
presets: [['@babel/preset-env', { loose: true, modules: false, targets }], '@babel/preset-react', '@babel/preset-typescript'], | ||
plugins: [ | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
['@babel/plugin-proposal-object-rest-spread', { loose: true }], | ||
['@babel/plugin-transform-runtime', { regenerator: false, useESModules }], | ||
], | ||
}) | ||
|
||
export default [ | ||
{ | ||
input: `./src/index`, | ||
output: { file: pkg.module, format: 'esm' }, | ||
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})], | ||
plugins: [babel(getBabelOptions({ useESModules: true }, '>1%, not dead, not ie 11, not op_mini all')), resolve({ extensions })], | ||
}, | ||
{ | ||
input: `./src/index`, | ||
output: { file: pkg.main, format: 'cjs' }, | ||
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})], | ||
plugins: [babel(getBabelOptions({ useESModules: false })), commonjs(), resolve({ extensions })], | ||
}, | ||
] | ||
|
||
// export default { | ||
// input: './src/index', | ||
// output: [{ file: pkg.main, format: 'cjs' }, { file: pkg.module, format: 'es' }], | ||
// external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})], | ||
// plugins: [babel()] | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.