代码拉取完成,页面将自动刷新
import NodePath from 'path';
import alias from '@rollup/plugin-alias';
import { eslint } from 'rollup-plugin-eslint';
import copy from 'rollup-plugin-copy';
// import url from '@rollup/plugin-url';
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const argv = yargs(hideBin(process.argv)).argv;
const isBuild = !(argv.dev || argv.watch);
const externals = [
'react',
'react-dom'
];
export default {
esm: isBuild ? false : 'rollup',
file: 'cloud-react',
// cjs: {
// type: 'rollup',
// minify: !argv.dev,
// },
umd: {
name: 'CloudReact',
file: 'cloud-react',
minFile: true,
},
entry: 'src/components/index.js',
extraExternals: externals,
extractCSS: isBuild,
// extraPostCSSPlugins: [
// require('postcss-font-base64')({
// //future options will be handled here
// })
// ],
extraRollupPlugins: [
eslint({
throwOnError: true,
include: [NodePath.resolve('src/components')],
/* your options */
}),
// url({
// include: ['**/*.woff', '**/*.woff2'],
// limit: Infinity,
// }),
// postcss({
// plugins: [require('postcss-font-base64')({
// //future options will be handled here
// })]
// }),
copy({
targets: [
{ src: 'package.json', dest: 'dist' },
]
}),
alias({
entries: [
{
find: '@utils',
replacement: NodePath.resolve(
NodePath.resolve(__dirname),
'src/utils',
),
// OR place `customResolver` here. See explanation below.
},
{
find: '@contexts',
replacement: NodePath.resolve(
NodePath.resolve(__dirname),
'src/contexts',
),
// OR place `customResolver` here. See explanation below.
},
{
find: '@tests',
replacement: NodePath.resolve(NodePath.resolve(__dirname), 'tests'),
// OR place `customResolver` here. See explanation below.
},
],
}),
],
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。