Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tfiechowski/bb2d19a6186e13b2f8d132986abd7321 to your computer and use it in GitHub Desktop.
Save tfiechowski/bb2d19a6186e13b2f8d132986abd7321 to your computer and use it in GitHub Desktop.
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
{
input,
output: {
file: packageJSON.browser,
format: "umd",
name: "reactSampleComponentsLibrary",
globals: {
react: "React",
"@emotion/styled": "styled",
"@emotion/core": "core"
}
},
plugins: [
babel({
exclude: "node_modules/**"
}),
external(),
resolve(),
commonjs()
]
},
{
input,
output: {
file: minifyExtension(packageJSON.browser),
format: "umd",
name: "reactSampleComponentsLibrary",
globals: {
react: "React",
"@emotion/styled": "styled",
"@emotion/core": "core"
}
},
plugins: [
babel({
exclude: "node_modules/**"
}),
external(),
resolve(),
commonjs(),
terser()
]
},
// ES ...
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment