1 Star 1 Fork 103

崔海东/form-create-designer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rollup.config.js 2.80 KB
一键复制 编辑 原始数据 按行查看 历史
xaboy 提交于 2021-05-05 18:05 . refactor: fix
/*
* @Author : djkloop
* @Date : 2021-04-04 23:18:00
* @LastEditors : djkloop
* @LastEditTime : 2021-04-05 12:44:31
* @Description : 头部注释
* @FilePath : /rollup.config.js
*/
const {join} = require('path');
import colors from 'chalk';
import {babel} from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import vuePlugin from 'rollup-plugin-vue';
import postcss from 'rollup-plugin-postcss';
import {nodeResolve} from '@rollup/plugin-node-resolve';
import {visualizer} from 'rollup-plugin-visualizer';
import externals from 'rollup-plugin-node-externals';
import buble from '@rollup/plugin-buble';
import formCreateNodeResolve from './build/plugins/form-create-rollup-reslove-plugins/node-resolve';
import {not_externals, isExternal} from './build/utils/isExternal';
import {cssUrl} from '@sixian/css-url';
const OutputOptions = require('./build/output');
const cwd = __dirname;
const globals = {
vue: 'Vue',
ELEMENT: 'element-ui'
};
module.exports = {
input: join(cwd, '/src/index.js'),
onwarn: (warning) => {
if (typeof warning === 'string') {
return colors.yellow('warning');
}
const code = (warning.code || '').toLowerCase();
if (code === 'mixed_exports' || code === 'missing_global_name') {
return;
}
let message = warning.message;
console.log(`${colors.yellow(`${code}`)}${colors.dim(':')} ${message}`);
},
output: OutputOptions(),
external:Object.keys(globals || {}).filter(
v => !/^[\.\/]/.test(v)
),
plugins: [
vuePlugin({
css: false
}),
postcss({
minimize: true,
extract: false,
plugins: [
cssUrl({
imgExtensions : /\.(png|jpg|jpeg|gif|svg)$/,
fontExtensions : /\.(ttf|woff|woff2|eot)$/,
limit : 8192,
hash : false,
slash : false
}),
]
}),
externals({
devDeps: false
}),
formCreateNodeResolve(),
nodeResolve({
extensions: ['.js', '.json', '.jsx', '.ts', '.tsx'],
preferBuiltins: true,
jsnext: true,
module: true
}),
commonjs({
ignore: (name) => {
return isExternal(not_externals, name);
}
}),
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.vue'],
}),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('production'),
}),
buble(),
visualizer()
]
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/cui-haidong/form-create-designer.git
git@gitee.com:cui-haidong/form-create-designer.git
cui-haidong
form-create-designer
form-create-designer
master

搜索帮助