mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
fix plugins relative issue
This commit is contained in:
parent
24f50220e1
commit
887ee982d8
1 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,10 @@ import { searchForPage } from './search.js';
|
||||||
import { existsSync } from 'fs';
|
import { existsSync } from 'fs';
|
||||||
import { loadConfiguration, logger as snowpackLogger, startServer as startSnowpackServer } from 'snowpack';
|
import { loadConfiguration, logger as snowpackLogger, startServer as startSnowpackServer } from 'snowpack';
|
||||||
|
|
||||||
|
// We need to use require.resolve for snowpack plugins, so create a require function here.
|
||||||
|
import { createRequire } from 'module';
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
interface RuntimeConfig {
|
interface RuntimeConfig {
|
||||||
astroConfig: AstroConfig;
|
astroConfig: AstroConfig;
|
||||||
logging: LogOptions;
|
logging: LogOptions;
|
||||||
|
@ -153,7 +157,12 @@ async function createSnowpack(astroConfig: AstroConfig, env: Record<string, any>
|
||||||
const snowpackConfig = await loadConfiguration({
|
const snowpackConfig = await loadConfiguration({
|
||||||
root: projectRoot.pathname,
|
root: projectRoot.pathname,
|
||||||
mount: mountOptions,
|
mount: mountOptions,
|
||||||
plugins: [[new URL('../snowpack-plugin.cjs', import.meta.url).pathname, astroPlugOptions], '@snowpack/plugin-sass', '@snowpack/plugin-svelte', '@snowpack/plugin-vue'],
|
plugins: [
|
||||||
|
[new URL('../snowpack-plugin.cjs', import.meta.url).pathname, astroPlugOptions],
|
||||||
|
require.resolve('@snowpack/plugin-sass'),
|
||||||
|
require.resolve('@snowpack/plugin-svelte'),
|
||||||
|
require.resolve('@snowpack/plugin-vue'),
|
||||||
|
],
|
||||||
devOptions: {
|
devOptions: {
|
||||||
open: 'none',
|
open: 'none',
|
||||||
output: 'stream',
|
output: 'stream',
|
||||||
|
|
Loading…
Add table
Reference in a new issue