Chore: Removed an extraneous build file

This commit is contained in:
Aria Minaei 2021-06-26 17:43:57 +02:00
parent 4be5c8f008
commit 28eaf15c7f

View file

@ -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<typeof build>[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'),
},
})
}
}