0 Star 1 Fork 0

Eyelly Wu / i18n-pro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rollup.config.js 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
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,
],
}
})
TypeScript
1
https://gitee.com/eyelly/i18n-pro.git
git@gitee.com:eyelly/i18n-pro.git
eyelly
i18n-pro
i18n-pro
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891