Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Integrated babel into build to make bundle compatible with ES5+ #774

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
plugins: [
['@babel/plugin-transform-runtime', { regenerator: true }], // Needed for IE9 build target
],
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
ie: 9,
},
},
],
],
}
18 changes: 14 additions & 4 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path'
import alias from '@rollup/plugin-alias'
// import babel from '@rollup/plugin-babel'
import babel from '@rollup/plugin-babel'
import { DEFAULT_EXTENSIONS } from '@babel/core'
import commonjs from '@rollup/plugin-commonjs'
import nodeResolve from '@rollup/plugin-node-resolve'
import replace from '@rollup/plugin-replace'
Expand Down Expand Up @@ -62,11 +63,10 @@ function rollupConfig ({
vue: 'Vue'
}
},
external,
external: [...external, /@babel\/runtime/],
plugins: [
replace(replaceConfig),
nodeResolve(),
commonjs(),
ts({
check: !didTS,
tsconfig: r('../tsconfig.json'),
Expand All @@ -79,7 +79,17 @@ function rollupConfig ({
},
exclude: ['node_modules', '__tests__', 'test-dts']
}
})
}),
babel({
babelHelpers: 'runtime',
exclude: 'node_modules/**',
extensions: [
...DEFAULT_EXTENSIONS,
'.ts',
'.tsx'
]
}),
commonjs()
].concat(plugins)
})

Expand Down
Loading