diff --git a/.changeset/gold-actors-greet.md b/.changeset/gold-actors-greet.md new file mode 100644 index 00000000..ce643bb9 --- /dev/null +++ b/.changeset/gold-actors-greet.md @@ -0,0 +1,5 @@ +--- +'@galactiks/astro-integration': patch +--- + +remove useless assets dir during build diff --git a/packages/adapters/astro/src/index.ts b/packages/adapters/astro/src/index.ts index b57647e7..32247ff7 100644 --- a/packages/adapters/astro/src/index.ts +++ b/packages/adapters/astro/src/index.ts @@ -76,11 +76,9 @@ export default function createPlugin(_: GalactiksOptions): AstroIntegration { galactiksConfig = setConfig('content.assets', assetsPath); publicPath = fileURLToPath(config.publicDir); + mkdirSync(publicPath, { recursive: true }) galactiksConfig = setConfig('content.public', publicPath); - publicAssetsPath = join(publicPath, 'assets'); - mkdirSync(publicAssetsPath, { recursive: true }) - updateConfig({ site: galactiksConfig.webManifest.start_url, trailingSlash, @@ -94,11 +92,10 @@ export default function createPlugin(_: GalactiksOptions): AstroIntegration { removeDirSymbolicLinks(assetsPath); removeDirSymbolicLinks(publicPath); - removeDirSymbolicLinks(publicAssetsPath); symlinkDir(assetsPath, galactiksConfigContentAssets); symlinkDir(publicPath, galactiksConfigContentPublic); - symlinkDir(publicAssetsPath, galactiksConfigContentAssets); + symlinkDir(publicPath, galactiksConfigContentAssets); if (command === 'dev') { addWatchFile(galactiksConfig.content.generated); @@ -109,7 +106,6 @@ export default function createPlugin(_: GalactiksOptions): AstroIntegration { 'astro:build:done': () => { removeDirSymbolicLinks(assetsPath); - rmdirSync(publicAssetsPath, { recursive: true }); removeDirSymbolicLinks(publicPath); }, },