@astrojs/cloudflare 14.0.0-beta.2 → 14.0.0-beta.3

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.
@@ -88,7 +88,7 @@ function serverStart({
88
88
  host,
89
89
  base
90
90
  }) {
91
- const version = "14.0.0-beta.2";
91
+ const version = "14.0.0-beta.3";
92
92
  const localPrefix = `${colors.dim("\u2503")} Local `;
93
93
  const networkPrefix = `${colors.dim("\u2503")} Network `;
94
94
  const emptyPrefix = " ".repeat(11);
package/dist/index.js CHANGED
@@ -105,6 +105,7 @@ function createIntegration({
105
105
  const needsImagesBindingForDev = isCompile && command === "dev";
106
106
  const usesContentCollections = hasContentCollectionsConfig(config.srcDir);
107
107
  const prebundleContentRuntime = command === "dev" && usesContentCollections;
108
+ const isTypeGenPhase = command === "build" || command === "sync";
108
109
  const adapterPluginConfig = {
109
110
  config: cloudflareConfigCustomizer({
110
111
  needsSessionKVBinding,
@@ -142,6 +143,16 @@ function createIntegration({
142
143
  ];
143
144
  const isAstroPrismPackageInstalled = await getIsAstroPrismInstalled(config.root);
144
145
  const userOptimizeDeps = config.vite?.optimizeDeps;
146
+ const cloudflareVitePlugins = cfVitePlugin({
147
+ ...cfPluginConfig,
148
+ viteEnvironment: { name: "ssr" },
149
+ assetsOnly: () => _buildOutput === "static"
150
+ });
151
+ if (isTypeGenPhase) {
152
+ for (const plugin of cloudflareVitePlugins) {
153
+ plugin.configureServer = void 0;
154
+ }
155
+ }
145
156
  updateConfig({
146
157
  build: {
147
158
  redirects: false
@@ -150,11 +161,7 @@ function createIntegration({
150
161
  vite: {
151
162
  plugins: [
152
163
  ...prerenderEnvironment === "node" && command === "dev" ? [createNodePrerenderPlugin()] : [],
153
- cfVitePlugin({
154
- ...cfPluginConfig,
155
- viteEnvironment: { name: "ssr" },
156
- assetsOnly: () => _buildOutput === "static"
157
- }),
164
+ cloudflareVitePlugins,
158
165
  {
159
166
  name: "@astrojs/cloudflare:cf-imports",
160
167
  enforce: "pre",
@@ -170,6 +177,9 @@ function createIntegration({
170
177
  {
171
178
  name: "@astrojs/cloudflare:environment",
172
179
  configEnvironment(environmentName, _options) {
180
+ if (isTypeGenPhase) {
181
+ return { optimizeDeps: { noDiscovery: true, include: [] } };
182
+ }
173
183
  const isServerEnvironment = ["astro", "ssr", "prerender"].includes(
174
184
  environmentName
175
185
  );
@@ -360,7 +370,7 @@ function createIntegration({
360
370
  },
361
371
  "astro:build:done": async ({ dir, logger, assets }) => {
362
372
  if (_config.base !== "/") {
363
- for (const file of [".assetsignore", "_headers"]) {
373
+ for (const file of [".assetsignore", "_headers", "_redirects"]) {
364
374
  try {
365
375
  await rename(
366
376
  new URL(`./${file}`, _config.build.client),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to Cloudflare Workers",
4
- "version": "14.0.0-beta.2",
4
+ "version": "14.0.0-beta.3",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -55,7 +55,7 @@
55
55
  "cheerio": "1.2.0",
56
56
  "devalue": "^5.8.1",
57
57
  "prismjs": "^1.30.0",
58
- "astro": "7.0.0-beta.3",
58
+ "astro": "7.0.0-beta.6",
59
59
  "astro-scripts": "0.0.14"
60
60
  },
61
61
  "publishConfig": {