2
0
mirror of https://github.com/frappe/books.git synced 2024-12-24 11:55:46 +00:00
books/config/rollup.js

47 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-05-08 05:59:46 +00:00
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
}