usdpl-decky-plugin-template/rollup.config.js
TrainDoctor e0ec175d16
Global dfl (#24)
* Initial global DFL support

* Update DFL

* Remove unmaintained makefile

* Move to CLI

* Properly extract zip files!

---------

Co-authored-by: AAGaming <aa@mail.catvibers.me>
2023-06-03 07:42:27 -07:00

38 lines
1,006 B
JavaScript

import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import typescript from '@rollup/plugin-typescript';
import { defineConfig } from 'rollup';
import importAssets from 'rollup-plugin-import-assets';
import { name } from "./plugin.json";
export default defineConfig({
input: './src/index.tsx',
plugins: [
commonjs(),
nodeResolve(),
typescript(),
json(),
replace({
preventAssignment: false,
'process.env.NODE_ENV': JSON.stringify('production'),
}),
importAssets({
publicPath: `http://127.0.0.1:1337/plugins/${name}/`
})
],
context: 'window',
external: ["react", "react-dom", "decky-frontend-lib"],
output: {
file: "dist/index.js",
globals: {
react: "SP_REACT",
"react-dom": "SP_REACTDOM",
"decky-frontend-lib": "DFL"
},
format: 'iife',
exports: 'default',
},
});