Skip to content

Commit

Permalink
client and executor has to be in @enonic/react4xp because of app name
Browse files Browse the repository at this point in the history
  • Loading branch information
ComLock committed Dec 13, 2024
1 parent 3f8ad58 commit 3dfc5cf
Showing 1 changed file with 0 additions and 102 deletions.
102 changes: 0 additions & 102 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -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 });
Expand Down Expand Up @@ -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
});

0 comments on commit 3dfc5cf

Please sign in to comment.