Still trying to get cra to play nice with theatre

This commit is contained in:
Aria Minaei 2021-08-07 23:24:37 +02:00
parent 824fdd6843
commit f4f33dcd8d
8 changed files with 88 additions and 62 deletions

View file

@ -17,14 +17,7 @@
"types": "dist/index.d.ts",
"type": "commonjs",
"files": [
"dist/index.cjs",
"dist/index.cjs.map",
"dist/index.mjs",
"dist/index.mjs.map",
"dist/index.min.js",
"dist/index.min.js.map",
"dist/index.min.js.LEGAL.txt",
"dist/index.d.ts"
"dist/*"
],
"scripts": {
"prepublish": "node ../../devEnv/ensurePublishing.js"

View file

@ -31,29 +31,29 @@ export function createBundles(watch: boolean) {
build({
...esbuildConfig,
outfile: path.join(pathToPackage, 'dist/index.cjs'),
outfile: path.join(pathToPackage, 'dist/index.js'),
format: 'cjs',
})
build({
...esbuildConfig,
outfile: path.join(pathToPackage, 'dist/index.mjs'),
format: 'esm',
})
// 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'),
},
})
// 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'),
// },
// })
}
}

View file

@ -16,14 +16,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/index.cjs",
"dist/index.cjs.map",
"dist/index.mjs",
"dist/index.mjs.map",
"dist/index.min.js",
"dist/index.min.js.map",
"dist/index.min.js.LEGAL.txt",
"dist/index.d.ts"
"dist/*"
],
"scripts": {
"prepublish": "node ../../devEnv/ensurePublishing.js"