-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from vojty/ts-build
Typescript build
- Loading branch information
Showing
9 changed files
with
11,990 additions
and
16,558 deletions.
There are no files selected for viewing
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
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,36 +1,53 @@ | ||
import babel from 'rollup-plugin-babel' | ||
import babel from '@rollup/plugin-babel' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import external from 'rollup-plugin-peer-deps-external' | ||
import image from '@rollup/plugin-image' | ||
import pkg from './package.json' | ||
import postcss from 'rollup-plugin-postcss' | ||
import dts from 'rollup-plugin-dts' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import typescript from '@rollup/plugin-typescript' | ||
import typescript from 'rollup-plugin-typescript2' | ||
|
||
export default { | ||
input: './src/lib/index.ts', | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
sourcemap: true | ||
const bundle = config => ({ | ||
...config, | ||
input: 'src/lib/index.ts' | ||
}) | ||
|
||
export default [ | ||
bundle({ | ||
plugins: [ | ||
typescript({ | ||
tsconfigOverride: { | ||
target: 'esnext' | ||
} | ||
}), | ||
external(), | ||
postcss(), | ||
babel({ | ||
babelHelpers: 'runtime' | ||
}), | ||
resolve(), | ||
commonjs(), | ||
image() | ||
], | ||
output: [ | ||
{ | ||
file: pkg.main, | ||
format: 'cjs', | ||
sourcemap: true | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'es', | ||
sourcemap: true | ||
}, | ||
] | ||
}), | ||
bundle({ | ||
plugins: [dts()], | ||
output: { | ||
file: pkg.types, | ||
format: 'es' | ||
}, | ||
{ | ||
file: pkg.module, | ||
format: 'esm', | ||
sourcemap: true | ||
} | ||
], | ||
plugins: [ | ||
typescript(), | ||
external(), | ||
postcss(), | ||
babel({ | ||
exclude: 'node_modules/**', | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'] | ||
}), | ||
resolve(), | ||
commonjs(), | ||
image() | ||
] | ||
} | ||
}) | ||
] |
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.