@yapyak/vite 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -5
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -178,11 +178,14 @@ function createConfigPlugin(state) {
178
178
  state.normalized = result.config;
179
179
  state.configFile = result.configFile;
180
180
  state.filter = createFilter(result.config.include, result.config.exclude);
181
- const ssrExternal = config.ssr?.external;
182
- if (Array.isArray(ssrExternal) && config.ssr) config.ssr.external = ssrExternal.filter((id) => !isRuntimeExternal(id));
183
- else if (ssrExternal === true || typeof ssrExternal === "function") {
184
- const description = typeof ssrExternal === "function" ? "a function" : "`true`";
185
- state.logger.warn(`[yapyak] config.ssr.external is set to ${description}. yapyak's runtime must not be externalized for SSR — translations would not inline. Use an array form for ssr.external, or have your function return false/null for 'yapyak' and 'yapyak/runtime'.`);
181
+ for (const [name, environment] of Object.entries(config.environments)) {
182
+ if (environment.consumer === "client") continue;
183
+ const external = environment.resolve.external;
184
+ if (external === true) {
185
+ state.logger.warn(`[yapyak] resolve.external is \`true\` for the ${name} environment. yapyak's runtime must not be externalized for SSR — translations would not inline. Use an array for ssr.external that leaves out 'yapyak' and '@yapyak/*'.`);
186
+ continue;
187
+ }
188
+ environment.resolve.external = external.filter((id) => !isRuntimeExternal(id));
186
189
  }
187
190
  state.resolver = createLocaleResolver({
188
191
  defaultLocale: result.config.defaultLocale,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yapyak/vite",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Vite plugin for yapyak.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -37,12 +37,12 @@
37
37
  "typescript": "6.0.3",
38
38
  "vite": "8.3.1",
39
39
  "vitest": "5.0.1",
40
- "@yapyak/tsdown-config": "0.0.0",
41
- "@yapyak/typescript-config": "0.0.0"
40
+ "@yapyak/typescript-config": "0.0.0",
41
+ "@yapyak/tsdown-config": "0.0.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "vite": ">=8",
45
- "yapyak": "0.0.16"
45
+ "yapyak": "0.0.18"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=22.22"