1 Star 0 Fork 110

逆心/form-create-designer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.locale.js 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
FormCreate 提交于 2024-05-28 18:31 . feat: 提交3.1.0版本
import {defineConfig} from 'vite'
import banner from 'vite-plugin-banner'
import {author, license, name, version} from './package.json'
function getBanner(banner, pkg) {
if (!banner || typeof banner === 'string') {
return banner || '';
}
banner = {...pkg, ...(banner === true ? {} : banner)};
const author = banner.author
const license = banner.license || '';
return (
'/*!\n' +
' * form-create 可视化表单设计器\n' +
` * ${banner.name} v${banner.version}\n` +
` * (c) ${author || ''}\n` +
(license && ` * Released under the ${license} License.\n`) +
' */'
);
}
function toCase(str) {
return str.replace(/(-[a-z])/g, function (v) {
return v.replace('-', '').toLocaleUpperCase();
});
}
function upper(str) {
return str.replace(str[0], str[0].toLocaleUpperCase());
}
const __banner__ = {
author: `2021-${new Date().getFullYear()} ${author}\n * Github https://github.com/xaboy/form-create-designer\n * Site https://form-create.com/`,
license,
name,
version
}
// https://vitejs.dev/config/
export default defineConfig((env) => {
const name = env.mode || 'en';
return {
build: {
outDir: 'locale',
lib: {
entry: `src/locale/${name}.js`,
name: 'FcDesigner' + upper(toCase(name)),
fileName: name,
},
emptyOutDir: false,
},
plugins: [banner(getBanner(__banner__))]
};
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zgn123456/form-create-designer.git
git@gitee.com:zgn123456/form-create-designer.git
zgn123456
form-create-designer
form-create-designer
next

搜索帮助

0d507c66 1850385 C8b1a773 1850385