Skip to content

Instantly share code, notes, and snippets.

@gyandeeps
Created August 26, 2016 22:18
Show Gist options
  • Save gyandeeps/c87644dac0479ded8faec4ea339732ed to your computer and use it in GitHub Desktop.
Save gyandeeps/c87644dac0479ded8faec4ea339732ed to your computer and use it in GitHub Desktop.
How to use rollup
import babel from 'rollup-plugin-babel';
import less from 'rollup-plugin-less';
import path from "path";
import includePaths from 'rollup-plugin-includepaths';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
import { minify } from 'uglify-js';
let includePathOptions = {
include: {
classNames: "classnames"
},
paths: ['./src/main/js/cerner/mpagedev/mpagefusion'],
external: [],
extensions: ['.js']
};
export default {
entry: "./src/main/js/cerner/mpagedev/mpagefusion/api.js",
dest: "./dist/fusion.js",
format: 'umd',
moduleName: "MPageFusion",
plugins: [
includePaths(includePathOptions),
nodeResolve({
jsnext: true,
main: true,
browser: true
}),
commonjs({
include: './node_modules/**'
}),
babel({
"presets": [
[
"es2015",
{
"modules": false
}
]
],
exclude: 'node_modules/**',
plugins: [
["defines", { "VERSION": "1" }],
["transform-es2015-classes", { loose: true }]
]
}),
less({
output: '',
option: {
//less render option
}
}),
uglify({
mangle: false
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment