mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
1153331cbb
commit
60136f9c56
3 changed files with 29 additions and 29 deletions
|
@ -4,32 +4,32 @@ import { resolve } from 'node:path';
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
/**
|
/**
|
||||||
* You can extend Alpine by setting this option to a root-relative import specifier (for example, `entrypoint: "/src/entrypoint"`).
|
* You can extend Alpine by setting this option to a root-relative import specifier (for example, `entrypoint: "/src/entrypoint"`).
|
||||||
*
|
*
|
||||||
* The default export of this file should be a function that accepts an Alpine instance prior to starting, allowing the use of custom directives, plugins and other customizations for advanced use cases.
|
* The default export of this file should be a function that accepts an Alpine instance prior to starting, allowing the use of custom directives, plugins and other customizations for advanced use cases.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* // astro.config.mjs
|
* // astro.config.mjs
|
||||||
* import { defineConfig } from 'astro/config';
|
* import { defineConfig } from 'astro/config';
|
||||||
* import alpine from '@astrojs/alpinejs';
|
* import alpine from '@astrojs/alpinejs';
|
||||||
*
|
*
|
||||||
* export default defineConfig({
|
* export default defineConfig({
|
||||||
* // ...
|
* // ...
|
||||||
* integrations: [alpine({ entrypoint: '/src/entrypoint' })],
|
* integrations: [alpine({ entrypoint: '/src/entrypoint' })],
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* // src/entrypoint.ts
|
* // src/entrypoint.ts
|
||||||
* import type { Alpine } from 'alpinejs'
|
* import type { Alpine } from 'alpinejs'
|
||||||
*
|
*
|
||||||
* export default (Alpine: Alpine) => {
|
* export default (Alpine: Alpine) => {
|
||||||
* Alpine.directive('foo', el => {
|
* Alpine.directive('foo', el => {
|
||||||
* el.textContent = 'bar';
|
* el.textContent = 'bar';
|
||||||
* })
|
* })
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
entrypoint?: string;
|
entrypoint?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ test.describe('Basics', () => {
|
||||||
test('Alpine is working', async ({ page, astro }) => {
|
test('Alpine is working', async ({ page, astro }) => {
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const el = page.locator("#foo")
|
const el = page.locator('#foo');
|
||||||
expect(await el.textContent()).toBe('bar')
|
expect(await el.textContent()).toBe('bar');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue