1 Star 0 Fork 0

iStop/hh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
const isProd = process.env.NODE_ENV === 'production';
const prodPlugins = [];
if (isProd) {
prodPlugins.push(terser());
}
function bundleConfig(name, entryFile) {
return {
input: {
[name]: entryFile,
},
output: {
dir: 'build/scripts/',
format: 'es',
chunkFileNames: '[name].bundle.js',
entryFileNames: '[name].bundle.js',
},
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
extensions: ['.js', '.ts', '.tsx'],
}),
nodeResolve({
extensions: ['.js', '.ts', '.tsx'],
}),
commonjs(),
...prodPlugins,
],
};
}
export default [
// Public-facing website
bundleConfig('site', 'h/static/scripts/site.js'),
// Preact app for creating new private groups.
bundleConfig('group-forms', 'h/static/scripts/group-forms/index.tsx'),
// Admin areas of the site
bundleConfig('admin-site', 'h/static/scripts/admin-site.js'),
// Header script inserted inline at the top of the page
bundleConfig('header', 'h/static/scripts/header.js'),
// Helper script for the OAuth post-authorization page.
bundleConfig('post-auth', 'h/static/scripts/post-auth.js'),
];
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/istop/h_.git
git@gitee.com:istop/h_.git
istop
h_
hh
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385