summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/portfolio/src/pages/index.astro2
-rw-r--r--packages/astro/src/runtime.ts45
2 files changed, 19 insertions, 28 deletions
diff --git a/examples/portfolio/src/pages/index.astro b/examples/portfolio/src/pages/index.astro
index fcdc21d60..d6616cfe0 100644
--- a/examples/portfolio/src/pages/index.astro
+++ b/examples/portfolio/src/pages/index.astro
@@ -5,7 +5,7 @@ import Nav from '../components/Nav/index.jsx';
import Footer from '../components/Footer/index.jsx';
import PorfolioPreview from '../components/PortfolioPreview/index.jsx';
-const projects = Astro.fetchContent('./project/*.md');
+const projects = Astro.fetchContent('./project/**/*.md');
const featuredProject = projects[0];
---
diff --git a/packages/astro/src/runtime.ts b/packages/astro/src/runtime.ts
index e9ddbeb1b..849642002 100644
--- a/packages/astro/src/runtime.ts
+++ b/packages/astro/src/runtime.ts
@@ -266,13 +266,12 @@ interface CreateSnowpackOptions {
env: Record<string, any>;
mode: RuntimeMode;
resolvePackageUrl?: (pkgName: string) => Promise<string>;
- target: 'frontend' | 'backend';
}
/** Create a new Snowpack instance to power Astro */
async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackOptions) {
const { projectRoot, astroRoot, extensions } = astroConfig;
- const { env, mode, resolvePackageUrl, target } = options;
+ const { env, mode, resolvePackageUrl } = options;
const internalPath = new URL('./frontend/', import.meta.url);
@@ -296,28 +295,6 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO
mountOptions[fileURLToPath(astroConfig.public)] = '/';
}
- const plugins: (string | [string, any])[] = [
- [fileURLToPath(new URL('../snowpack-plugin.cjs', import.meta.url)), astroPlugOptions],
- [require.resolve('@snowpack/plugin-svelte'), { compilerOptions: { hydratable: true } }],
- require.resolve('@snowpack/plugin-vue'),
- ];
-
- // note: styles only need processing once
- if (target === 'frontend') {
- plugins.push(require.resolve('@snowpack/plugin-sass'));
- plugins.push([
- require.resolve('@snowpack/plugin-postcss'),
- {
- config: {
- plugins: {
- [require.resolve('autoprefixer')]: {},
- ...(astroConfig.devOptions.tailwindConfig ? { [require.resolve('tailwindcss')]: {} } : {}),
- },
- },
- },
- ]);
- }
-
// Tailwind: IDK what this does but it makes JIT work 🤷‍♂️
if (astroConfig.devOptions.tailwindConfig) {
(process.env as any).TAILWIND_DISABLE_TOUCH = true;
@@ -327,7 +304,23 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO
root: fileURLToPath(projectRoot),
mount: mountOptions,
mode,
- plugins,
+ plugins: [
+ [fileURLToPath(new URL('../snowpack-plugin.cjs', import.meta.url)), astroPlugOptions],
+ [require.resolve('@snowpack/plugin-svelte'), { compilerOptions: { hydratable: true } }],
+ require.resolve('@snowpack/plugin-vue'),
+ require.resolve('@snowpack/plugin-sass'),
+ [
+ require.resolve('@snowpack/plugin-postcss'),
+ {
+ config: {
+ plugins: {
+ [require.resolve('autoprefixer')]: {},
+ ...(astroConfig.devOptions.tailwindConfig ? { [require.resolve('tailwindcss')]: {} } : {}),
+ },
+ },
+ },
+ ],
+ ],
devOptions: {
open: 'none',
output: 'stream',
@@ -367,7 +360,6 @@ export async function createRuntime(astroConfig: AstroConfig, { mode, logging }:
},
mode,
resolvePackageUrl,
- target: 'backend',
});
debug(logging, 'core', `backend snowpack created [${stopTimer(timer.backend)}]`);
@@ -377,7 +369,6 @@ export async function createRuntime(astroConfig: AstroConfig, { mode, logging }:
astro: false,
},
mode,
- target: 'frontend',
});
debug(logging, 'core', `frontend snowpack created [${stopTimer(timer.frontend)}]`);