keycloak-scim/themes/rollup.config.js
dependabot[bot] 97e681c1a8
Bump @rollup/plugin-commonjs from 26.0.1 to 28.0.1 (#34018)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 26.0.1 to 28.0.1.
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v28.0.1/packages/commonjs)

---
updated-dependencies:
- dependency-name: "@rollup/plugin-commonjs"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-20 17:13:57 +02:00

53 lines
1.3 KiB
JavaScript

import { defineConfig } from "rollup";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import replace from "@rollup/plugin-replace";
import terser from "@rollup/plugin-terser";
import path from "node:path";
const plugins = [
nodeResolve(),
commonjs({
strictRequires: "auto",
}),
replace({
preventAssignment: true,
// React depends on process.env.NODE_ENV to determine which code to include for production.
// This ensures that no additional code meant for development is included in the build.
"process.env.NODE_ENV": '"production"',
}),
terser(),
];
const targetDir = "target/classes/theme/keycloak/common/resources/vendor";
export default defineConfig([
{
input: [
"node_modules/react/cjs/react.production.min.js",
"node_modules/react/cjs/react-jsx-runtime.production.min.js",
],
output: {
dir: path.join(targetDir, "react"),
format: "es",
},
plugins,
},
{
input: "node_modules/react-dom/cjs/react-dom.production.min.js",
output: {
dir: path.join(targetDir, "react-dom"),
format: "es",
},
external: ["react"],
plugins,
},
{
input: "src/main/js/web-crypto-shim.js",
output: {
dir: path.join(targetDir, "web-crypto-shim"),
format: "es",
},
plugins,
},
]);