cloudflare/d1-northwind
Publicmirrored fromhttps://github.com/cloudflare/d1-northwindAvailable
rollup.app.config.js
49lines · modecode
| 1 | import { terser } from "rollup-plugin-terser"; |
| 2 | // import { string } from "rollup-plugin-string"; |
| 3 | import { nodeResolve } from "@rollup/plugin-node-resolve"; |
| 4 | import commonjs from "@rollup/plugin-commonjs"; |
| 5 | import babel from "@rollup/plugin-babel"; |
| 6 | import postcss from "rollup-plugin-postcss"; |
| 7 | import postcssImport from "postcss-import"; |
| 8 | import tailwindcss from "tailwindcss"; |
| 9 | import autoprefixer from "autoprefixer"; |
| 10 | import postcssNested from "postcss-nested"; |
| 11 | import replace from "@rollup/plugin-replace"; |
| 12 | |
| 13 | export default [ |
| 14 | { |
| 15 | input: "app/index.jsx", |
| 16 | cache: true, |
| 17 | onwarn: function (message, warn) { |
| 18 | // https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined |
| 19 | if (message.code == "THIS_IS_UNDEFINED") return; |
| 20 | warn(message); |
| 21 | }, |
| 22 | output: { |
| 23 | format: "iife", |
| 24 | file: "dist/app.js", |
| 25 | sourcemap: true, |
| 26 | }, |
| 27 | plugins: [ |
| 28 | babel({ |
| 29 | presets: ["@babel/preset-react"], |
| 30 | babelHelpers: "bundled", |
| 31 | exclude: "node_modules/**", |
| 32 | compact: false, |
| 33 | }), |
| 34 | replace({ |
| 35 | "process.env.NODE_ENV": JSON.stringify("production"), |
| 36 | preventAssignment: true, |
| 37 | }), |
| 38 | postcss({ |
| 39 | plugins: [postcssImport(), tailwindcss(), autoprefixer(), postcssNested()], |
| 40 | extensions: [".css"], |
| 41 | extract: true, |
| 42 | minimize: true, |
| 43 | }), |
| 44 | commonjs(), |
| 45 | nodeResolve({ browser: true }), |
| 46 | terser(), |
| 47 | ], |
| 48 | }, |
| 49 | ]; |
| 50 | |