Prevent snowpaack from running on a port
This commit is contained in:
parent
aff6390cc7
commit
01c34ac5d4
1 changed files with 10 additions and 4 deletions
14
src/dev.ts
14
src/dev.ts
|
@ -28,7 +28,7 @@ export default async function(astroConfig: AstroConfig) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = await loadConfiguration({
|
const snowpackConfig = await loadConfiguration({
|
||||||
root: projectRoot.pathname,
|
root: projectRoot.pathname,
|
||||||
mount: {
|
mount: {
|
||||||
[hmxRoot.pathname]: '/_hmx',
|
[hmxRoot.pathname]: '/_hmx',
|
||||||
|
@ -37,14 +37,20 @@ export default async function(astroConfig: AstroConfig) {
|
||||||
plugins: [
|
plugins: [
|
||||||
['hmx-v2/snowpack-plugin', hmxPlugOptions]
|
['hmx-v2/snowpack-plugin', hmxPlugOptions]
|
||||||
],
|
],
|
||||||
//exclude: [`${internalPath.pathname}**/*`],
|
devOptions: {
|
||||||
devOptions: {open: 'none', output: 'stream'},
|
open: 'none',
|
||||||
|
output: 'stream',
|
||||||
|
port: 0
|
||||||
|
},
|
||||||
packageOptions: {
|
packageOptions: {
|
||||||
knownEntrypoints: ['preact-render-to-string'],
|
knownEntrypoints: ['preact-render-to-string'],
|
||||||
external: ['@vue/server-renderer']
|
external: ['@vue/server-renderer']
|
||||||
}
|
}
|
||||||
}, snowpackConfigPath.pathname);
|
}, snowpackConfigPath.pathname);
|
||||||
const snowpack = await startSnowpackServer({config, lockfile: null});
|
const snowpack = await startSnowpackServer({
|
||||||
|
config: snowpackConfig,
|
||||||
|
lockfile: null
|
||||||
|
});
|
||||||
const runtime = snowpack.getServerRuntime();
|
const runtime = snowpack.getServerRuntime();
|
||||||
|
|
||||||
const server = http.createServer(async (req, res) => {
|
const server = http.createServer(async (req, res) => {
|
||||||
|
|
Loading…
Reference in a new issue