🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
48
node_modules/astro/dist/config/index.js
generated
vendored
Normal file
48
node_modules/astro/dist/config/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
function defineConfig(config) {
|
||||
return config;
|
||||
}
|
||||
function getViteConfig(inlineConfig) {
|
||||
return async ({ mode, command }) => {
|
||||
const cmd = command === "serve" ? "dev" : command;
|
||||
const [
|
||||
fs,
|
||||
{ mergeConfig },
|
||||
{ nodeLogDestination },
|
||||
{ openConfig, createSettings },
|
||||
{ createVite },
|
||||
{ runHookConfigSetup, runHookConfigDone },
|
||||
{ astroContentListenPlugin }
|
||||
] = await Promise.all([
|
||||
import("node:fs"),
|
||||
import("vite"),
|
||||
import("../core/logger/node.js"),
|
||||
import("../core/config/index.js"),
|
||||
import("../core/create-vite.js"),
|
||||
import("../integrations/index.js"),
|
||||
import("./vite-plugin-content-listen.js")
|
||||
]);
|
||||
const logging = {
|
||||
dest: nodeLogDestination,
|
||||
level: "info"
|
||||
};
|
||||
const { astroConfig: config } = await openConfig({ cmd });
|
||||
const settings = createSettings(config, inlineConfig.root);
|
||||
await runHookConfigSetup({ settings, command: cmd, logging });
|
||||
const viteConfig = await createVite(
|
||||
{
|
||||
mode,
|
||||
plugins: [
|
||||
// Initialize the content listener
|
||||
astroContentListenPlugin({ settings, logging, fs })
|
||||
]
|
||||
},
|
||||
{ settings, logging, mode }
|
||||
);
|
||||
await runHookConfigDone({ settings, logging });
|
||||
return mergeConfig(viteConfig, inlineConfig);
|
||||
};
|
||||
}
|
||||
export {
|
||||
defineConfig,
|
||||
getViteConfig
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue