mirror of
https://github.com/webstudio-is/webstudio.git
synced 2025-03-14 09:57:02 +00:00
Here added one more description file for components `*.template.tsx`. It is decoupled from component meta to fix the issue with some templates like Sheet being treated as components though we don't have actual components with this name. Another reason is have it separately to not include builder specific code and dependencies into CLI and published websites. Template package is defined as optional in peer dependencies meta. In this PR migrated only Button and List as examples. There is still not support for data sources and styles. Added support for text placeholders in children
32 lines
638 B
TypeScript
32 lines
638 B
TypeScript
import { defineConfig } from "vite";
|
|
|
|
const isBareImport = (id: string) =>
|
|
id.startsWith("@") || id.includes(".") === false;
|
|
|
|
export default defineConfig({
|
|
// resolve only webstudio condition in tests
|
|
resolve: {
|
|
conditions: ["webstudio"],
|
|
},
|
|
build: {
|
|
lib: {
|
|
entry: [
|
|
"src/components.ts",
|
|
"src/metas.ts",
|
|
"src/props.ts",
|
|
"src/hooks.ts",
|
|
"src/templates.ts",
|
|
],
|
|
formats: ["es"],
|
|
},
|
|
rollupOptions: {
|
|
external: isBareImport,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: "src",
|
|
dir: "lib",
|
|
},
|
|
},
|
|
},
|
|
});
|