mirror of
https://github.com/SteamDeckHomebrew/decky-plugin-template.git
synced 2025-11-10 18:47:29 -06:00
moved to deckbuild
This commit is contained in:
parent
b05ecd55e7
commit
54ba277a12
18 changed files with 590 additions and 107 deletions
|
|
@ -1,23 +1,26 @@
|
|||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import json from '@rollup/plugin-json';
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import { defineConfig } from 'rollup';
|
||||
import {defineConfig} from 'rollup';
|
||||
import importAssets from 'rollup-plugin-import-assets';
|
||||
|
||||
import { name } from "./plugin.json";
|
||||
import {name} from "./plugin.json";
|
||||
import {createPathTransform} from "rollup-sourcemap-path-transform";
|
||||
|
||||
const production = process.env.NODE_ENV !== 'development'
|
||||
|
||||
export default defineConfig({
|
||||
input: './src/index.tsx',
|
||||
input: './src/ts/index.tsx',
|
||||
plugins: [
|
||||
commonjs(),
|
||||
nodeResolve(),
|
||||
typescript(),
|
||||
nodeResolve({browser: true}),
|
||||
typescript({sourceMap: !production, inlineSources: !production}),
|
||||
json(),
|
||||
replace({
|
||||
preventAssignment: false,
|
||||
'process.env.NODE_ENV': JSON.stringify('production'),
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
}),
|
||||
importAssets({
|
||||
publicPath: `http://127.0.0.1:1337/plugins/${name}/`
|
||||
|
|
@ -27,6 +30,15 @@ export default defineConfig({
|
|||
external: ['react', 'react-dom'],
|
||||
output: {
|
||||
file: 'dist/index.js',
|
||||
sourcemap: !production ? 'inline' : false,
|
||||
sourcemapPathTransform: !production ? createPathTransform({
|
||||
prefixes: {
|
||||
"../src/src/ts/": `/plugins/${name}/src/`,
|
||||
"../node_modules/.pnpm/": `/plugins/${name}/node_modules/`
|
||||
},
|
||||
requirePrefix: true
|
||||
}) : undefined,
|
||||
footer: () => !production ? `\n//# sourceURL=http://localhost:1337/plugins/${name}/frontend_bundle` : "",
|
||||
globals: {
|
||||
react: 'SP_REACT',
|
||||
'react-dom': 'SP_REACTDOM',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue