2020-03-15 09:05:18 +01:00
|
|
|
import {terser} from "rollup-plugin-terser";
|
|
|
|
import typescript from "@rollup/plugin-typescript";
|
|
|
|
import resolve from "@rollup/plugin-node-resolve";
|
|
|
|
import commonjs from "@rollup/plugin-commonjs";
|
|
|
|
|
|
|
|
const isProd = process.env.NODE_ENV === "production";
|
|
|
|
|
|
|
|
const typescriptOptions = {include: ["src/**/*", "../shared/**/*"]};
|
|
|
|
if (!isProd) typescriptOptions.noEmitOnError = false;
|
|
|
|
|
|
|
|
module.exports = {
|
2020-03-15 09:56:24 +01:00
|
|
|
input: "src/server.ts",
|
2020-03-15 09:05:18 +01:00
|
|
|
plugins: [
|
2020-03-15 09:56:24 +01:00
|
|
|
typescript(typescriptOptions),
|
2020-03-15 09:05:18 +01:00
|
|
|
commonjs({extensions: [".js", ".ts"]}),
|
|
|
|
resolve({extensions: [".js", ".ts"]}),
|
2020-03-15 09:56:24 +01:00
|
|
|
isProd && terser()
|
2020-03-15 09:05:18 +01:00
|
|
|
],
|
|
|
|
output: {
|
|
|
|
file: "dist/bundle.js",
|
|
|
|
name: "ucaptcha",
|
|
|
|
format: "iife"
|
|
|
|
}
|
|
|
|
};
|