summaryrefslogtreecommitdiff
path: root/snowpack-plugin.cjs
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-03-31 13:04:18 -0600
committerGravatar GitHub <noreply@github.com> 2021-03-31 13:04:18 -0600
commit3fa6396a7b092258c994d0bee6719b89b45c7bf8 (patch)
tree0e0c1b842831bae8d4bfc4b643ebb6f4f7d13f7f /snowpack-plugin.cjs
parenta3b20a9affaee976c3e1f3019016fb096b1516fb (diff)
downloadastro-3fa6396a7b092258c994d0bee6719b89b45c7bf8.tar.gz
astro-3fa6396a7b092258c994d0bee6719b89b45c7bf8.tar.zst
astro-3fa6396a7b092258c994d0bee6719b89b45c7bf8.zip
Extract Astro styles to external stylesheets (#43)
* Extract Astro styles to external stylesheets * Require relative URLs in Markdown layouts
Diffstat (limited to '')
-rw-r--r--snowpack-plugin.cjs8
1 files changed, 6 insertions, 2 deletions
diff --git a/snowpack-plugin.cjs b/snowpack-plugin.cjs
index dcb714ea6..4a4db8efd 100644
--- a/snowpack-plugin.cjs
+++ b/snowpack-plugin.cjs
@@ -9,7 +9,7 @@ module.exports = function (snowpackConfig, { resolve, extensions, astroConfig }
knownEntrypoints: ['deepmerge'],
resolve: {
input: ['.astro', '.md'],
- output: ['.js'],
+ output: ['.js', '.css'],
},
async load({ filePath }) {
const { compileComponent } = await transformPromise;
@@ -21,7 +21,11 @@ module.exports = function (snowpackConfig, { resolve, extensions, astroConfig }
extensions,
};
const result = await compileComponent(contents, { compileOptions, filename: filePath, projectRoot });
- return result.contents;
+ const output = {
+ '.js': result.contents,
+ };
+ if (result.css) output['.css'] = result.css;
+ return output;
},
};
};