1 Star 0 Fork 0

cn-frappe/datatable

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup.config.js 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
import json from 'rollup-plugin-json';
import uglify from 'rollup-plugin-uglify-es';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import nested from 'postcss-nested';
import customProperties from 'postcss-custom-properties';
import autoprefixer from 'autoprefixer';
import eslint from 'rollup-plugin-eslint';
import merge from 'deepmerge';
const production = process.env.NODE_ENV === 'production';
const baseJS = {
input: 'src/index.js',
output: {
file: '',
globals: {
sortablejs: 'Sortable',
'clusterize.js': 'Clusterize'
}
},
plugins: [
json(),
eslint({
exclude: '**/*.json'
}),
nodeResolve(),
commonjs()
],
external: ['sortablejs', 'clusterize.js']
};
const baseCSS = {
input: 'src/style.css',
output: {
file: ''
},
plugins: [
postcss({
extract: true,
minimize: production,
plugins: [
customProperties(),
nested(),
autoprefixer()
]
})
]
};
const devIIFE = merge(baseJS, {
output: {
file: 'dist/frappe-datatable.js',
format: 'iife',
name: 'DataTable'
}
});
const devCjs = merge(baseJS, {
output: {
file: 'dist/frappe-datatable.cjs.js',
format: 'cjs'
}
});
const devCSS = merge(baseCSS, {
output: {
file: 'dist/frappe-datatable.css',
format: 'cjs'
}
});
// production
const prodIIFE = merge(devIIFE, {
output: {
file: 'dist/frappe-datatable.min.js'
},
plugins: [
uglify()
]
});
const prodCSS = merge(devCSS, {
output: {
file: 'dist/frappe-datatable.min.css'
}
});
const developmentAssets = [devIIFE, devCjs, devCSS];
const productionAssets = [prodIIFE, prodCSS];
const assets = production ? productionAssets : developmentAssets;
export default assets;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cn-frappe/datatable.git
git@gitee.com:cn-frappe/datatable.git
cn-frappe
datatable
datatable
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385