mirror of
https://github.com/frappe/books.git
synced 2024-12-24 11:55:46 +00:00
47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
|
const commonjs = require('rollup-plugin-commonjs');
|
||
|
const json = require('rollup-plugin-json');
|
||
|
const html = require('rollup-plugin-html');
|
||
|
const nodeResolve = require('rollup-plugin-node-resolve');
|
||
|
const precss = require('precss');
|
||
|
const autoprefixer = require('autoprefixer');
|
||
|
const postcss = require('rollup-plugin-postcss');
|
||
|
|
||
|
const getJSConfig = ({input, output}) => ({
|
||
|
input: input,
|
||
|
output: {
|
||
|
file: output,
|
||
|
format: 'iife',
|
||
|
name: 'desk',
|
||
|
sourcemap: true,
|
||
|
globals: ['io', 'nunjucks'], // for socketio client, which is imported directly,
|
||
|
},
|
||
|
plugins: [
|
||
|
commonjs(),
|
||
|
json(),
|
||
|
html(),
|
||
|
nodeResolve(),
|
||
|
],
|
||
|
});
|
||
|
|
||
|
const getCSSConfig = ({input, output}) => ({
|
||
|
input: input,
|
||
|
output: {
|
||
|
file: output,
|
||
|
format: 'cjs'
|
||
|
},
|
||
|
plugins: [
|
||
|
postcss({
|
||
|
extract: true,
|
||
|
plugins: [
|
||
|
precss,
|
||
|
autoprefixer
|
||
|
]
|
||
|
})
|
||
|
]
|
||
|
});
|
||
|
|
||
|
module.exports = {
|
||
|
getJSConfig,
|
||
|
getCSSConfig
|
||
|
}
|