加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 2.48 KB
一键复制 编辑 原始数据 按行查看 历史
Luiz Américo 提交于 2019-11-14 21:50 . Do not emit interopDefault helper
import pkg from './package.json';
import babel from 'rollup-plugin-babel';
import copy from 'rollup-plugin-cpy';
const external = [
'stream',
'fs',
'zlib',
'fontkit',
'events',
'linebreak',
'png-js',
'crypto-js',
'saslprep'
];
export default [
// CommonJS build for Node
{
input: 'lib/document.js',
external,
output: {
name: 'pdfkit',
file: pkg.main,
format: 'cjs',
sourcemap: true,
interop: false
},
plugins: [
babel({
babelrc: false,
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
node: '6.10'
}
}
]
]
}),
copy({
files: ['lib/font/data/*.afm'],
dest: 'js/data'
})
]
},
// ES for legacy (IE11) browsers
{
input: 'lib/document.js',
external,
output: {
name: 'pdfkit.es5',
file: pkg.module,
format: 'es',
sourcemap: true
},
plugins: [
babel({
babelrc: false,
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
browsers: ['ie 11']
},
exclude: ['@babel/plugin-transform-typeof-symbol']
}
]
]
})
]
},
// ES for green browsers
{
input: 'lib/document.js',
external,
output: {
name: 'pdfkit.esnext',
file: pkg.esnext,
format: 'es',
sourcemap: true
},
plugins: [
babel({
babelrc: false,
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
browsers: [
'Firefox 57',
'Edge 15',
'Chrome 60',
'iOS 10',
'Safari 10'
]
}
}
]
]
})
]
},
{
input: 'lib/virtual-fs.js',
external,
output: {
name: 'virtual-fs',
file: 'js/virtual-fs.js',
format: 'cjs',
sourcemap: false
},
plugins: [
babel({
babelrc: false,
presets: [
[
'@babel/preset-env',
{
loose: true,
modules: false,
targets: {
browsers: ['ie 11']
}
}
]
]
})
]
}
];
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化