1 Star 0 Fork 1

文昶/butterfly

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
无惟 提交于 2020-05-06 10:47 . fix: pack webpack css
import path from 'path';
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
import postcss from 'rollup-plugin-postcss';
import commonjs from 'rollup-plugin-commonjs';
import extensions from 'rollup-plugin-extensions';
import external from 'rollup-plugin-peer-deps-external';
import url from "rollup-plugin-url"
import pkg from './package.json';
const config = {
presets: [
'@babel/preset-react',
'@babel/preset-env'
],
plugins: [
'@babel/plugin-proposal-class-properties'
]
};
const plugins = [
extensions({
extensions: ['.js'],
resolveIndex: true,
}),
external(),
babel(Object.assign({
exclude: [
'node_modules/**',
]
}, config)),
postcss({
extract: true,
modules: false,
use: [
[
'less',
{
javascriptEnabled: true,
}
]
]
}),
commonjs(),
json(),
url({
limit: 100 * 1024, // inline files < 100k, copy files > 100k
include: ["**/*.svg", "**/*.eot", "**/*.tff", "**/*.woff", "**/*.woff2"], // defaults to .svg, .png, .jpg and .gif files
emitFiles: true // defaults to true
})
];
const rollupCfg = [];
// all in one 构建
rollupCfg.push({
input: path.join(__dirname, 'index.js'),
output: [
{
file: pkg.pack,
format: 'cjs',
exports: 'named',
sourcemap: true
},
{
file: pkg.es,
format: 'es',
sourcemap: true
}
],
plugins
});
export default rollupCfg;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wenchang666/butterfly.git
[email protected]:wenchang666/butterfly.git
wenchang666
butterfly
butterfly
master

搜索帮助