2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00
books/config/rollup.js
2018-05-08 11:29:46 +05:30

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
}