add kirby-loop plugin with French translations
All checks were successful
Deploy / Deploy to Production (push) Successful in 6s
All checks were successful
Deploy / Deploy to Production (push) Successful in 6s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8ea5f0c462
commit
ab7fd8b2ea
74 changed files with 16423 additions and 2 deletions
69
site/plugins/loop/frontend/vite.config.ts
Normal file
69
site/plugins/loop/frontend/vite.config.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/// <reference types="vitest" />
|
||||
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||
import { resolve, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
||||
import { ViteEjsPlugin } from 'vite-plugin-ejs'
|
||||
import { browserslistToTargets } from 'lightningcss';
|
||||
import browserslist from "browserslist"
|
||||
|
||||
// Isomorphic dirname
|
||||
const _dirname =
|
||||
typeof __dirname !== "undefined"
|
||||
? __dirname
|
||||
: dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// Config
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
return {
|
||||
base: env.VITE_DEMO_BASE,
|
||||
compilerOptions: {
|
||||
hmr: !process.env.VITEST && mode !== 'production',
|
||||
},
|
||||
build: {
|
||||
cssMinify: 'lightningcss',
|
||||
minify: true,
|
||||
lib: {
|
||||
entry: resolve(_dirname, "src/main.ts"),
|
||||
name: "Loop",
|
||||
fileName: "loop",
|
||||
formats: ["es"],
|
||||
},
|
||||
outDir: "../assets",
|
||||
},
|
||||
css: {
|
||||
transformer: 'lightningcss',
|
||||
lightningcss: {
|
||||
drafts: {
|
||||
customMedia: true
|
||||
},
|
||||
targets: browserslistToTargets(browserslist(["last 2 versions", ">= 0.4%", "not dead", "Firefox ESR", "not op_mini all", "not and_uc > 0"]))
|
||||
}
|
||||
},
|
||||
define: {
|
||||
APP_VERSION: JSON.stringify(process.env.npm_package_version),
|
||||
},
|
||||
plugins: [
|
||||
svelte({ compilerOptions: { customElement: true } }),
|
||||
cssInjectedByJsPlugin(),
|
||||
ViteEjsPlugin((viteConfig) => ({
|
||||
// viteConfig is the current Vite resolved config
|
||||
env: viteConfig.env,
|
||||
}))
|
||||
],
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
},
|
||||
server: {
|
||||
allowedHosts: ['kirby-loop.test'],
|
||||
cors: {
|
||||
// Allow ddev and .test domains
|
||||
origin: /https?:\/\/([A-Za-z0-9\-\.]+)?(\.(ddev\.site|test))(?::\d+)?$/,
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue