-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve typegen, automatic default
include
- Loading branch information
1 parent
cd9e502
commit 78fa55a
Showing
8 changed files
with
148 additions
and
55 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import icon from 'astro-icon'; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [ | ||
icon() | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
import type { AstroIntegration } from "astro"; | ||
import type { IntegrationOptions } from "../typings/integration"; | ||
import { createPlugin } from "./vite-plugin-astro-icon.js"; | ||
import type { AstroIntegration } from 'astro'; | ||
|
||
export default function createIntegration( | ||
opts: IntegrationOptions = {} | ||
): AstroIntegration { | ||
return { | ||
name: "astro-icon", | ||
hooks: { | ||
async "astro:config:setup"({ updateConfig, command, config }) { | ||
"astro:config:setup"({ updateConfig, config, logger }) { | ||
const external = config.output === 'static' ? ['@iconify-json/*'] : undefined; | ||
const { root, output } = config; | ||
updateConfig({ | ||
vite: { | ||
plugins: [await createPlugin(opts, { root: config.root })], | ||
plugins: [createPlugin(opts, { root, output, logger })], | ||
ssr: { | ||
external | ||
} | ||
}, | ||
}); | ||
}, | ||
}, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters