代码拉取完成,页面将自动刷新
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;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。