代码拉取完成,页面将自动刷新
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'),
];
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。