Created
August 2, 2019 10:11
-
-
Save tfiechowski/bb99a47f4afba59f7763fffe716135ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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 commonjs from "rollup-plugin-commonjs"; | |
import resolve from "rollup-plugin-node-resolve"; | |
import external from "rollup-plugin-peer-deps-external"; | |
import { terser } from "rollup-plugin-terser"; | |
import { uglify } from "rollup-plugin-uglify"; | |
import packageJSON from "./package.json"; | |
const input = "./src/index.js"; | |
const minifyExtension = pathToFile => pathToFile.replace(/\.js$/, ".min.js"); | |
export default [ | |
// CommonJS ... | |
// UMD ... | |
// ES | |
{ | |
input, | |
output: { | |
file: packageJSON.module, | |
format: "es", | |
exports: "named" | |
}, | |
plugins: [ | |
babel({ | |
exclude: "node_modules/**" | |
}), | |
external(), | |
resolve(), | |
commonjs() | |
] | |
}, | |
{ | |
input, | |
output: { | |
file: minifyExtension(packageJSON.module), | |
format: "es", | |
exports: "named" | |
}, | |
plugins: [ | |
babel({ | |
exclude: "node_modules/**" | |
}), | |
external(), | |
resolve(), | |
commonjs(), | |
terser() | |
] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment