Skip to content

Commit

Permalink
refactor(bundle): dont use ts for creating es2015 code
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Feb 25, 2021
1 parent 4b0fcc1 commit deea7cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import bundleSize from 'rollup-plugin-bundle-size';
import replace from '@rollup/plugin-replace';
import svgr from '@svgr/rollup';
import typescript from 'rollup-plugin-typescript2';
import { DEFAULT_EXTENSIONS as DEFAULT_BABEL_EXTENSIONS } from '@babel/core';

import pkg from './package.json';

Expand Down Expand Up @@ -46,10 +47,6 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec
minimize: isProd,
inject: injectCSS,
}),
babel({
exclude: 'node_modules/**',
babelHelpers: 'runtime',
}),
svgr(),
resolve(),
typescript({
Expand All @@ -58,6 +55,11 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec
commonjs({
include: 'node_modules/**',
}),
babel({
extensions: [...DEFAULT_BABEL_EXTENSIONS, '.ts', '.tsx'],
exclude: 'node_modules/**',
babelHelpers: 'runtime',
}),
],
});

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"compilerOptions": {
"outDir": "dist",
"module": "esnext",
"target": "es5",
"lib": ["es6", "dom", "es2016", "es2017"],
"target": "esnext",
"lib": ["dom", "esnext"],
"jsx": "react",
"moduleResolution": "node",
"declaration": true,
Expand Down

0 comments on commit deea7cd

Please sign in to comment.