代码拉取完成,页面将自动刷新
import ts from 'rollup-plugin-typescript2'
import prettier from 'rollup-plugin-prettier'
import { terser } from 'rollup-plugin-terser'
import { version, name } from './package.json'
const formats = ['umd', 'umd.min']
const copyright =
'Copyright (c) 2022-present Eyelly Wu <https://github.com/eyelly-wu>'
const banner = `/*
* ${name}
* v${version}
* ${new Date().toLocaleString()}
* ${copyright}
*/`
const minBanner = `// ${name} v${version} ${new Date().toLocaleString()} ${copyright}`
export default formats.map((format, index) => {
const isLast = index === formats.length - 1
let pluginsExtra = []
const suffix = format.split('.')[1]
if (format.includes('.')) {
pluginsExtra.push(
terser({
format: {
comments: /i18n-pro/,
},
}),
)
}
return {
input: 'src/lib/index.ts',
output: {
file: `dist/src/lib/index${suffix ? '.' + suffix : ''}.js`,
format: format.includes('.') ? format.split('.')[0] : format,
banner: suffix ? minBanner : banner,
name: 'i18nPro',
},
plugins: [
ts({
useTsconfigDeclarationDir: isLast,
tsconfigOverride: {
compilerOptions: {
removeComments: false,
declaration: isLast,
declarationDir: 'dist',
module: 'ESNext',
target: 'es5',
},
},
}),
prettier(),
...pluginsExtra,
],
}
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。