From 3dfc5cfa5622545d9fa0fbfdd90cfcaa9b7b2ac8 Mon Sep 17 00:00:00 2001 From: Christian Westgaard Date: Thu, 12 Dec 2024 10:22:54 +0100 Subject: [PATCH] client and executor has to be in @enonic/react4xp because of app name --- tsup.config.ts | 102 ------------------------------------------------- 1 file changed, 102 deletions(-) diff --git a/tsup.config.ts b/tsup.config.ts index f317a79b..3a08af98 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,8 +1,6 @@ -// import manifestPlugin from 'esbuild-plugin-manifest'; // import {print} from 'q-i'; import { defineConfig } from 'tsup'; -// const minify = false; export default defineConfig((options) => { // print(options, { maxItems: Infinity }); @@ -56,104 +54,4 @@ export default defineConfig((options) => { tsconfig: 'tsconfig.nashorn.json' }; } // server - // if (options?.entry?.['client']) { - // return { - // entry: 'src/main/resources/assets/react4xp/client.ts', - // esbuildOptions(options, context) { - // options.external = [ - // //'prop-types', - // 'react', - // 'react-dom' - // ]; - // // options.globals // Doesn't exist :( - // }, - // esbuildPlugins: [ - // manifestPlugin({ - // extensionless: 'input', - // filename: 'client.manifest.json', - // generate: (entries) => { - // return { - // 'client.js': entries['client'] - // }; - // }, - // shortNames: true - // }) - // ], - // // For some reason this doesn't work here, but it does under esbuildOptions - // // external: [ - // // //'prop-types', - // // 'react', - // // 'react-dom' - // // ], - // format: [ - // // 'cjs', - // // 'esm', - // 'iife' // tsup has no umd - // ], - // minify, - // outDir: 'build/resources/main/assets/react4xp', - // platform: 'browser', - // sourcemap: minify, - // splitting: false, - // tsconfig: 'src/main/resources/assets/tsconfig.json' - // } - // } // client - // if (options?.entry?.['executor']) { - // return { - // entry: 'src/main/resources/assets/react4xp/executor.ts', - // esbuildOptions(options, context) { - // // print(options, { maxItems: Infinity }); - // // print(context, { maxItems: Infinity }); - // // options.entryNames = '[dir]/[name]-[hash]'; - // // options.entryNames = '[name]-[hash]'; // Seems like name contains dir? So enable shortNames - // }, - // esbuildPlugins: [ - // manifestPlugin({ - // extensionless: 'input', - // filename: 'executor.manifest.json', - // // A custom Function to create the manifest. - // // The passed function should match the signature of - // // (entries: {[key: string]: string}) => Object; - // // and can return anything as long as it's serialisable by - // // JSON.stringify. - // generate: (entries) => { - // // print(entries, { maxItems: Infinity }); - // return { - // 'executor.js': entries['executor'] - // }; - // }, - // // By default we assume that you want to hash the output - // // files. We use [dir]/[name]-[hash] as the default hash - // // format. You can disable hashing by setting this to false - // // or you can set your own hash format by directly using - // // esbuild's entryNames option. - // // hash: false, - // shortNames: true - // }) - // ], - // external: [ - // //'prop-types', - // 'react', - // 'react-dom' - // ], - // format: [ - // // 'cjs', - // // 'esm', - // 'iife' // tsup has no umd - // ], - // minify, - // outDir: 'build/resources/main/assets/react4xp', - // platform: 'browser', - // sourcemap: minify, - - // // Code splitting currently only works with the esm output format, - // // and it's enabled by default. If you want code splitting for cjs - // // output format as well, try using --splitting flag which is an - // // experimental feature to get rid of the limitation in esbuild. - // splitting: false, - - // // target: 'es5', - // tsconfig: 'src/main/resources/assets/tsconfig.json' - // } - // } // executor });