You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/integrations/alpinejs/README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,10 @@ The Alpine.js integration does not give you control over how the script is loade
67
67
68
68
**It is not currently possible to [extend Alpine.js](https://alpinejs.dev/advanced/extending) when using this component.** If you need this feature, consider following [the manual Alpine.js setup](https://alpinejs.dev/essentials/installation) instead using an Astro script tag:
2. Add the following to your `astro.config.mjs` file:
27
27
28
-
```js ins={3, 6-7}
29
-
// astro.config.mjs
30
-
import { defineConfig } from'astro/config';
31
-
importcloudflarefrom'@astrojs/cloudflare';
32
-
33
-
exportdefaultdefineConfig({
34
-
output:'server',
35
-
adapter:cloudflare(),
36
-
});
28
+
```diff lang="ts"
29
+
// astro.config.mjs
30
+
import { defineConfig } from 'astro/config';
31
+
+import cloudflare from '@astrojs/cloudflare';
32
+
33
+
export default defineConfig({
34
+
+ output: 'server',
35
+
+ adapter: cloudflare(),
36
+
});
37
37
```
38
38
39
39
## Options
@@ -61,16 +61,17 @@ In `directory` mode, the adapter will compile the client-side part of your app t
61
61
62
62
To instead compile a separate bundle for each page, set the `functionPerPath` option in your Cloudflare adapter config. This option requires some manual maintenance of the `functions` folder. Files emitted by Astro will overwrite existing `functions` files with identical names, so you must choose unique file names for each file you manually add. Additionally, the adapter will never empty the `functions` folder of outdated files, so you must clean up the folder manually when you remove pages.
63
63
64
-
```diff
65
-
import {defineConfig} from "astro/config";
66
-
import cloudflare from '@astrojs/cloudflare';
64
+
```diff lang="ts"
65
+
// astro.config.mjs
66
+
import {defineConfig} from "astro/config";
67
+
import cloudflare from '@astrojs/cloudflare';
67
68
68
-
export default defineConfig({
69
-
adapter: cloudflare({
70
-
mode: 'directory',
71
-
+functionPerRoute: true
69
+
export default defineConfig({
70
+
adapter: cloudflare({
71
+
mode: 'directory',
72
+
+ functionPerRoute: true
72
73
})
73
-
})
74
+
})
74
75
```
75
76
76
77
Note that this adapter does not support using [Cloudflare Pages Middleware](https://developers.cloudflare.com/pages/platform/functions/middleware/). Astro will bundle the [Astro middleware](https://docs.astro.build/en/guides/middleware/) into each page.
@@ -147,18 +148,18 @@ If you want to use the automatic `_routes.json` generation, but want to exclude
147
148
148
149
The following example automatically generates `_routes.json` while including and excluding additional routes. Note that that is only necessary if you have custom functions in the `functions` folder that are not handled by Astro.
149
150
150
-
```diff
151
-
// astro.config.mjs
152
-
export default defineConfig({
151
+
```diff lang="ts"
152
+
// astro.config.mjs
153
+
export default defineConfig({
153
154
adapter: cloudflare({
154
-
mode: 'directory',
155
-
+routes: {
156
-
+strategy: 'include',
157
-
+include: ['/users/*'], // handled by custom function: functions/users/[id].js
158
-
+exclude: ['/users/faq'], // handled by static page: pages/users/faq.astro
159
-
+},
155
+
mode: 'directory',
156
+
+ routes: {
157
+
+ strategy: 'include',
158
+
+ include: ['/users/*'], // handled by custom function: functions/users/[id].js
159
+
+ exclude: ['/users/faq'], // handled by static page: pages/users/faq.astro
160
+
+ },
160
161
}),
161
-
});
162
+
});
162
163
```
163
164
164
165
## Enabling Preview
@@ -287,24 +288,24 @@ Whether or not to import `.wasm` files [directly as ES modules](https://github.c
287
288
288
289
Add `wasmModuleImports: true` to `astro.config.mjs` to enable in both the Cloudflare build and the Astro dev server.
289
290
290
-
```diff
291
-
// astro.config.mjs
292
-
import {defineConfig} from "astro/config";
293
-
import cloudflare from '@astrojs/cloudflare';
291
+
```diff lang="ts"
292
+
// astro.config.mjs
293
+
import {defineConfig} from "astro/config";
294
+
import cloudflare from '@astrojs/cloudflare';
294
295
295
-
export default defineConfig({
296
+
export default defineConfig({
296
297
adapter: cloudflare({
297
-
+wasmModuleImports: true
298
+
+ wasmModuleImports: true
298
299
}),
299
-
output: 'server'
300
-
})
300
+
output: 'server'
301
+
})
301
302
```
302
303
303
304
Once enabled, you can import a web assembly module in Astro with a `.wasm?module` import.
304
305
305
306
The following is an example of importing a Wasm module that then responds to requests by adding the request's number parameters together.
306
307
307
-
```javascript
308
+
```js
308
309
// pages/add/[a]/[b].js
309
310
importmodfrom'../util/add.wasm?module';
310
311
@@ -366,19 +367,20 @@ You can also check our [Astro Integration Documentation][astro-integration] for
366
367
367
368
### Meaningful error messages
368
369
369
-
Currently, errors during running your application in Wrangler are not very useful, due to the minification of your code. For better debugging, you can add `vite.build.minify = false` setting to your `astro.config.js`
370
+
Currently, errors during running your application in Wrangler are not very useful, due to the minification of your code. For better debugging, you can add `vite.build.minify = false` setting to your `astro.config.mjs`.
Now, apply this integration to your `astro.config.*` file using the `integrations` property:
44
44
45
-
```js ins={3} "lit()"
46
-
// astro.config.mjs
47
-
import { defineConfig } from'astro/config';
48
-
importlitfrom'@astrojs/lit';
49
-
50
-
exportdefaultdefineConfig({
51
-
// ...
52
-
integrations: [lit()],
53
-
});
45
+
```diff lang="js" "lit()"
46
+
// astro.config.mjs
47
+
import { defineConfig } from 'astro/config';
48
+
+ import lit from '@astrojs/lit';
49
+
50
+
export default defineConfig({
51
+
// ...
52
+
integrations: [lit()],
53
+
// ^^^^^
54
+
});
54
55
```
55
56
56
57
## Getting started
@@ -121,15 +122,16 @@ These globals _can_ interfere with other libraries that might use the existence
121
122
122
123
Because of this, the Lit integration might not be compatible with these types of libraries. One thing that can help is changing the order of integrations when Lit is interfering with other integrations:
123
124
124
-
```diff
125
-
import { defineConfig } from 'astro/config';
126
-
import vue from '@astrojs/vue';
127
-
import lit from '@astrojs/lit';
125
+
```diff lang="js"
126
+
// astro.config.mjs
127
+
import { defineConfig } from 'astro/config';
128
+
import vue from '@astrojs/vue';
129
+
import lit from '@astrojs/lit';
128
130
129
-
export default defineConfig({
130
-
- integrations: [vue(), lit()]
131
-
+ integrations: [lit(), vue()]
132
-
});
131
+
export default defineConfig({
132
+
-integrations: [vue(), lit()]
133
+
+integrations: [lit(), vue()]
134
+
});
133
135
```
134
136
135
137
The correct order might be different depending on the underlying cause of the problem. This is not guaranteed to fix every issue however, and some libraries cannot be used if you are using the Lit integration because of this.
@@ -138,7 +140,8 @@ The correct order might be different depending on the underlying cause of the pr
138
140
139
141
When using a [strict package manager](https://pnpm.io/pnpm-vs-npm#npms-flat-tree) like `pnpm`, you may get an error such as `ReferenceError: module is not defined` when running your site. To fix this, hoist Lit dependencies with an `.npmrc` file:
Copy file name to clipboardExpand all lines: packages/integrations/markdoc/README.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,15 +42,15 @@ npm install @astrojs/markdoc
42
42
43
43
Then, apply this integration to your `astro.config.*` file using the `integrations` property:
44
44
45
-
```js ins={3} "markdoc()"
46
-
// astro.config.mjs
47
-
import { defineConfig } from'astro/config';
48
-
importmarkdocfrom'@astrojs/markdoc';
49
-
50
-
exportdefaultdefineConfig({
51
-
// ...
52
-
integrations: [markdoc()],
53
-
});
45
+
```diff lang="js" "markdoc()"
46
+
// astro.config.mjs
47
+
import { defineConfig } from 'astro/config';
48
+
+import markdoc from '@astrojs/markdoc';
49
+
export default defineConfig({
50
+
// ...
51
+
integrations: [markdoc()],
52
+
// ^^^^^^^^^
53
+
});
54
54
```
55
55
56
56
### Editor Integration
@@ -443,15 +443,16 @@ By default, Markdoc will not recognize HTML markup as semantic content.
443
443
444
444
To achieve a more Markdown-like experience, where HTML elements can be included alongside your content, set `allowHTML:true` as a `markdoc` integration option. This will enable HTML parsing in Markdoc markup.
You may see this when running the entry script if it was built with npm or Yarn. This is a known issue that may be fixed in a future release. As a workaround, add `"path-to-regexp"` to the `noExternal` array:
194
198
195
-
```js ins={9-13}
196
-
// astro.config.mjs
197
-
import { defineConfig } from'astro/config';
198
-
199
-
importnodefrom'@astrojs/node';
199
+
```diff lang="js"
200
+
// astro.config.mjs
201
+
import { defineConfig } from'astro/config';
202
+
importnodefrom'@astrojs/node';
200
203
201
-
exportdefaultdefineConfig({
202
-
output:'server',
203
-
adapter:node(),
204
-
vite: {
205
-
ssr: {
206
-
noExternal: ['path-to-regexp'],
207
-
},
208
-
},
209
-
});
204
+
exportdefaultdefineConfig({
205
+
output:'server',
206
+
adapter:node(),
207
+
+ vite: {
208
+
+ ssr: {
209
+
+ noExternal: ['path-to-regexp'],
210
+
+ },
211
+
+ },
212
+
});
210
213
```
211
214
212
215
For more help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help!
0 commit comments