├── LICENSE ├── README.md ├── pnpm-workspace.yaml ├── turbo.json ├── demo ├── vite.config.mjs ├── .gitignore ├── package.json ├── src │ └── my-component.webc └── index.html ├── plugin ├── package.json ├── README.md ├── LICENSE └── index.mjs ├── package.json ├── .gitignore └── pnpm-lock.yaml /LICENSE: -------------------------------------------------------------------------------- 1 | plugin/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | plugin/README.md -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'demo' 3 | - 'plugin' 4 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turborepo.org/schema.json", 3 | "pipeline": { 4 | "build": { 5 | "dependsOn": ["^build"], 6 | "outputs": ["dist/**"], 7 | "cache": false 8 | }, 9 | "preview": { 10 | "dependsOn": ["build"] 11 | }, 12 | "dev": { 13 | "cache": false 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demo/vite.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import VitePluginWebc from 'vite-plugin-webc'; 3 | import postcssPresetEnv from 'postcss-preset-env'; 4 | 5 | export default defineConfig({ 6 | plugins: [VitePluginWebc()], 7 | css: { 8 | postcss: { 9 | plugins: [postcssPresetEnv({ features: { 'nesting-rules': true } })], 10 | }, 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-plugin-webc", 3 | "version": "0.2.0", 4 | "license": "MIT", 5 | "type": "module", 6 | "exports": { 7 | ".": "./index.mjs" 8 | }, 9 | "files": [ 10 | "index.mjs", 11 | "LICENSE" 12 | ], 13 | "dependencies": {}, 14 | "peerDependencies": { 15 | "@11ty/webc": "^0.5.3" 16 | }, 17 | "devDependencies": { 18 | "@11ty/webc": "^0.5.3", 19 | "vite": "^3.1.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-plugin-webc-demo", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "open-props": "1.4.16" 13 | }, 14 | "devDependencies": { 15 | "postcss": "^8.4.18", 16 | "postcss-preset-env": "^7.8.2", 17 | "vite": "^3.1.0", 18 | "vite-plugin-webc": "*" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /demo/src/my-component.webc: -------------------------------------------------------------------------------- 1 | hello world 2 | 3 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-plugin-webc-monorepo", 3 | "version": "0.0.0", 4 | "private": true, 5 | "workspaces": [ 6 | "demo", 7 | "plugin" 8 | ], 9 | "scripts": { 10 | "build": "turbo run build", 11 | "preview": "turbo run preview", 12 | "dev": "turbo run dev --parallel" 13 | }, 14 | "devDependencies": { 15 | "turbo": "latest" 16 | }, 17 | "engines": { 18 | "node": ">=16.0.0" 19 | }, 20 | "dependencies": {}, 21 | "packageManager": "pnpm@7.11.0" 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | .pnp 6 | .pnp.js 7 | 8 | # testing 9 | coverage 10 | 11 | # next.js 12 | .next/ 13 | out/ 14 | build 15 | 16 | # misc 17 | .DS_Store 18 | *.pem 19 | 20 | # debug 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | .pnpm-debug.log* 25 | 26 | # local env files 27 | .env.local 28 | .env.development.local 29 | .env.test.local 30 | .env.production.local 31 | 32 | # turbo 33 | .turbo 34 | -------------------------------------------------------------------------------- /plugin/README.md: -------------------------------------------------------------------------------- 1 | # vite-plugin-webc 2 | 3 | A vite plugin for [WebC](https://github.com/11ty/webc). 4 | 5 | 1. Install webc and the plugin: 6 | 7 | ```shell 8 | npm i -D vite-plugin-webc @11ty/webc 9 | ``` 10 | 11 | 2. Add the plugin to the vite config: 12 | 13 | ```js 14 | import { defineConfig } from 'vite'; 15 | import VitePluginWebc from 'vite-plugin-webc'; 16 | 17 | export default defineConfig({ 18 | plugins: [VitePluginWebc()], 19 | }); 20 | ``` 21 | 22 | 3. Define your .webc files anywhere in the `src/` directory and start using them in your html! 23 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |