diff options
author | 2021-04-16 13:15:27 -0400 | |
---|---|---|
committer | 2021-04-16 13:15:27 -0400 | |
commit | 58c499dc854b5f8173c95016b1c5da4145cccd96 (patch) | |
tree | 8aba772e5aaaa8b2520499a30e683fea1a460db5 /src | |
parent | 2a7aa765b47c2d3acd038224ea167c54de910f29 (diff) | |
download | astro-58c499dc854b5f8173c95016b1c5da4145cccd96.tar.gz astro-58c499dc854b5f8173c95016b1c5da4145cccd96.tar.zst astro-58c499dc854b5f8173c95016b1c5da4145cccd96.zip |
Pass mode into snowpack runtime (#99)
* Pass the `mode` through to snowpack
This allows the production packages to be prepared.
* Use snowpack 3.3.1
* Update path to prism loadComponents external ref
* Upgrade to snowpack 3.3.2
Diffstat (limited to 'src')
-rw-r--r-- | src/parser/parse/read/expression.ts | 1 | ||||
-rw-r--r-- | src/runtime.ts | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/parser/parse/read/expression.ts b/src/parser/parse/read/expression.ts index fae1f54e8..f0033354d 100644 --- a/src/parser/parse/read/expression.ts +++ b/src/parser/parse/read/expression.ts @@ -243,7 +243,6 @@ export const parse_expression_at = (source: string, index: number): Expression = // @ts-ignore export default function read_expression(parser: Parser) { try { - debugger; const expression = parse_expression_at(parser.template, parser.index); parser.index = expression.end; return expression; diff --git a/src/runtime.ts b/src/runtime.ts index b21d790ec..190db41f0 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -230,7 +230,7 @@ interface RuntimeOptions { } /** Create a new Snowpack instance to power Astro */ -async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any>) { +async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any>, mode: RuntimeMode) { const { projectRoot, astroRoot, extensions } = astroConfig; const internalPath = new URL('./frontend/', import.meta.url); @@ -258,6 +258,7 @@ async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any> const snowpackConfig = await loadConfiguration({ root: fileURLToPath(projectRoot), mount: mountOptions, + mode: mode, plugins: [ [fileURLToPath(new URL('../snowpack-plugin.cjs', import.meta.url)), astroPlugOptions], require.resolve('@snowpack/plugin-sass'), @@ -274,7 +275,7 @@ async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any> }, packageOptions: { knownEntrypoints: ['preact-render-to-string'], - external: ['@vue/server-renderer', 'node-fetch', 'prismjs/components/'], + external: ['@vue/server-renderer', 'node-fetch', 'prismjs/components/index.js'], }, }); @@ -294,11 +295,11 @@ async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any> export async function createRuntime(astroConfig: AstroConfig, { mode, logging }: RuntimeOptions): Promise<AstroRuntime> { const { snowpack: backendSnowpack, snowpackRuntime: backendSnowpackRuntime, snowpackConfig: backendSnowpackConfig } = await createSnowpack(astroConfig, { astro: true, - }); + }, mode); const { snowpack: frontendSnowpack, snowpackRuntime: frontendSnowpackRuntime, snowpackConfig: frontendSnowpackConfig } = await createSnowpack(astroConfig, { astro: false, - }); + }, mode); const runtimeConfig: RuntimeConfig = { astroConfig, |