代码拉取完成,页面将自动刷新
同步操作将从 craft-codeless-designer/ craft-codeless-designer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import image from '@rollup/plugin-image';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import autoExternal from 'rollup-plugin-auto-external';
import postcss from 'rollup-plugin-postcss';
import typescript from 'rollup-plugin-typescript2';
import { uglify } from 'rollup-plugin-uglify';
import packageJson from './package.json';
const { visualizer } = require('rollup-plugin-visualizer');
const path = require('path');
const license = require('rollup-plugin-license');
const env = JSON.stringify(process.env.NODE_ENV || 'development');
export default {
input: './src/index.jsx',
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true,
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true,
},
],
plugins: [
autoExternal(),
json(),
image(),
postcss({
extensions: ['.css', '.scss', '.sass', '.less'],
}),
nodeResolve({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
}),
replace({
exclude: 'node_modules/**',
ENV: env,
__DEV__: env === 'development' ? true : false,
__PROD__: env === 'production' ? true : false,
preventAssignment: true,
}),
babel({
exclude: 'node_modules/**',
presets: ['@babel/env', '@babel/preset-react'],
plugins: [
[
'@babel/plugin-proposal-class-properties',
{
loose: true,
},
],
],
}),
commonjs(),
typescript(),
process.env.NODE_ENV === 'production' &&
uglify({
output: {
comments: function (node, comment) {
if (comment.type === 'comment2') {
// multiline comment
return /@preserve|@license|@cc_on/i.test(comment.value);
}
return false;
},
},
}),
license({
sourcemap: true,
banner: {
commentStyle: 'regular',
content: {
file: path.join(__dirname, 'LICENSE'),
encoding: 'utf-8',
},
},
thirdParty: {
allow: '(MIT OR Apache-2.0)',
},
}),
visualizer(),
],
external: ['react', 'react-dom', 'react-i18next', 'react-scripts', 'react-test-renderer', 'react-app-polyfill', 'styled-components'],
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。