UNPKG

react-searchable-select

Version:
65 lines (57 loc) 1.28 kB
/** @format */ import styles from "rollup-plugin-styles"; import autoprefixer from "autoprefixer"; import babel from "@rollup/plugin-babel"; import sourcemaps from "rollup-plugin-sourcemaps"; import image from "rollup-plugin-img"; // the entry point for the library const input = "src/index.js"; // var MODE = [ { fomart: "cjs", }, { fomart: "esm", }, { fomart: "umd", }, ]; var config = []; MODE.map((m) => { var conf = { input: input, output: { // then name of your package name: "react-searchable-select", file: `dist/index.${m.fomart}.js`, format: m.fomart, exports: "auto", interop: "auto", }, // this externelizes react to prevent rollup from compiling it external: ["react", /@babel\/runtime/], plugins: [ image({ limit: 10000, }), // these are babel comfigurations babel({ exclude: "node_modules/**", plugins: ["@babel/transform-runtime"], babelHelpers: "runtime", }), // this adds sourcemaps sourcemaps(), // this adds support for styles styles({ postcss: { plugins: [autoprefixer()], }, }), ], }; config.push(conf); }); export default [...config];