Created
August 26, 2016 22:18
-
-
Save gyandeeps/c87644dac0479ded8faec4ea339732ed to your computer and use it in GitHub Desktop.
How to use rollup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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