Avoid bundling dependencies; Build CommonJS target

This commit is contained in:
Danny McGee
2023-12-08 01:00:49 -05:00
parent 2131eec891
commit ffff83f7ca
3 changed files with 18 additions and 8 deletions
+6 -6
View File
@@ -1,12 +1,12 @@
{
"name": "@storyteller/studio-web",
"version": "0.0.1",
"dependencies": {},
"dependencies": {
"@storyteller/framework": "0.0.1",
"@storyteller/studio": "0.0.1",
"lit": "^2.8.0"
},
"main": "./index.js",
"module": "./index.mjs",
"typings": "./index.d.ts",
"exports": {
"./canvas-provider": "./canvas-provider.element.js",
"./viewer": "./viewer.element.js"
}
"typings": "./index.d.ts"
}
+6
View File
@@ -7,6 +7,12 @@
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"dependsOn": [
{
"projects": ["studio"],
"target": "build:web"
}
],
"options": {
"outputPath": "dist/studio-web"
}
+6 -2
View File
@@ -35,11 +35,15 @@ export default defineConfig({
fileName: "index",
// Change this to the formats you want to support.
// Don't forget to update your package.json as well.
formats: ["es"],
formats: ["es", "cjs"],
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: [],
external: [
"lit",
"@storyteller/framework",
"@storyteller/studio",
],
},
},