mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
Rollup config generator
This commit is contained in:
parent
695f02eb49
commit
bf59d21af7
@ -1,18 +0,0 @@
|
||||
module.exports = {
|
||||
input: './www/index.js',
|
||||
output: {
|
||||
file: './www/dist/js/bundle.js',
|
||||
format: 'iife',
|
||||
name: 'desk',
|
||||
sourcemap: true,
|
||||
globals: ['io', 'nunjucks'], // for socketio client, which is imported directly,
|
||||
},
|
||||
plugins: [
|
||||
require('rollup-plugin-commonjs')(),
|
||||
require('rollup-plugin-json')(),
|
||||
require('rollup-plugin-html')(),
|
||||
require('rollup-plugin-node-resolve')({
|
||||
preferBuiltins: true
|
||||
}),
|
||||
],
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
input: './node_modules/frappejs/client/style/style.scss',
|
||||
output: {
|
||||
file: './www/dist/css/style.css',
|
||||
format: 'cjs'
|
||||
},
|
||||
plugins: [
|
||||
require('rollup-plugin-postcss')({
|
||||
extract: true,
|
||||
plugins: [
|
||||
require('precss'),
|
||||
require('autoprefixer')
|
||||
]
|
||||
})
|
||||
]
|
||||
};
|
46
config/rollup.js
Normal file
46
config/rollup.js
Normal file
@ -0,0 +1,46 @@
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue
Block a user