From 28eaf15c7f8ec80b8f124726bcf861c820202a03 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Sat, 26 Jun 2021 17:43:57 +0200 Subject: [PATCH] Chore: Removed an extraneous build file --- theatre/devEnv/utils.ts | 60 ----------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 theatre/devEnv/utils.ts 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'), - }, - }) - } -}