diff --git a/theatre/devEnv/utils.ts b/theatre/devEnv/utils.ts deleted file mode 100644 index 84a4beb..0000000 --- a/theatre/devEnv/utils.ts +++ /dev/null @@ -1,60 +0,0 @@ -import path from 'path' -import {build} from 'esbuild' - -export const definedGlobals = { - global: 'window', - 'process.env.version': JSON.stringify( - require('../studio/package.json').version, - ), -} - -const a: any = 'hi' - -export function createBundles() { - for (const which of ['core', 'studio']) { - const pathToPackage = path.join(__dirname, '../', which) - const esbuildConfig: Parameters[0] = { - entryPoints: [path.join(pathToPackage, 'src/index.ts')], - target: ['firefox88', 'chrome90'], - loader: {'.png': 'file'}, - bundle: true, - sourcemap: true, - define: definedGlobals, - external: ['@theatre/dataverse'], - } - - if (which === 'core') { - esbuildConfig.platform = 'neutral' - esbuildConfig.mainFields = ['browser', 'module', 'main'] - esbuildConfig.target = ['firefox57', 'chrome58'] - esbuildConfig.conditions = ['browser', 'node'] - } - - build({ - ...esbuildConfig, - outfile: path.join(pathToPackage, 'dist/index.cjs'), - format: 'cjs', - }) - - build({ - ...esbuildConfig, - outfile: path.join(pathToPackage, 'dist/index.mjs'), - format: 'esm', - }) - - build({ - ...esbuildConfig, - outfile: path.join(pathToPackage, 'dist/index.min.js'), - format: 'iife', - external: [], - minify: true, - globalName: `Theatre.${which}`, - legalComments: 'external', - platform: 'browser', - define: { - ...definedGlobals, - 'process.env.NODE_ENV': JSON.stringify('production'), - }, - }) - } -}