[ci] yarn format
This commit is contained in:
parent
180dfcf2fc
commit
76195ba404
3 changed files with 8 additions and 7 deletions
|
@ -113,7 +113,7 @@ async function clientBuild(opts: StaticBuildOptions, internals: BuildInternals,
|
||||||
const { astroConfig, viteConfig } = opts;
|
const { astroConfig, viteConfig } = opts;
|
||||||
|
|
||||||
// Nothing to do if there is no client-side JS.
|
// Nothing to do if there is no client-side JS.
|
||||||
if(!input.size) {
|
if (!input.size) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,15 +265,17 @@ export function vitePluginNewBuild(input: Set<string>, internals: BuildInternals
|
||||||
|
|
||||||
config(config, options) {
|
config(config, options) {
|
||||||
const extra: Partial<UserConfig> = {};
|
const extra: Partial<UserConfig> = {};
|
||||||
const noExternal = [], external = [];
|
const noExternal = [],
|
||||||
if(options.command === 'build' && config.build?.ssr) {
|
external = [];
|
||||||
|
if (options.command === 'build' && config.build?.ssr) {
|
||||||
noExternal.push('astro');
|
noExternal.push('astro');
|
||||||
external.push('shiki');
|
external.push('shiki');
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
extra.ssr = {
|
extra.ssr = {
|
||||||
external, noExternal
|
external,
|
||||||
|
noExternal,
|
||||||
};
|
};
|
||||||
return extra;
|
return extra;
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
|
||||||
let { filename, query } = parseAstroRequest(id);
|
let { filename, query } = parseAstroRequest(id);
|
||||||
if (query.astro) {
|
if (query.astro) {
|
||||||
if (query.type === 'style') {
|
if (query.type === 'style') {
|
||||||
if(filename.startsWith('/@fs')) {
|
if (filename.startsWith('/@fs')) {
|
||||||
filename = filename.slice('/@fs'.length);
|
filename = filename.slice('/@fs'.length);
|
||||||
} else if (filename.startsWith('/') && !ancestor(filename, config.projectRoot.pathname)) {
|
} else if (filename.startsWith('/') && !ancestor(filename, config.projectRoot.pathname)) {
|
||||||
filename = new URL('.' + filename, config.projectRoot).pathname;
|
filename = new URL('.' + filename, config.projectRoot).pathname;
|
||||||
|
|
|
@ -5,14 +5,13 @@ import { loadFixture } from './test-utils.js';
|
||||||
describe('Code component inside static build', () => {
|
describe('Code component inside static build', () => {
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
fixture = await loadFixture({
|
fixture = await loadFixture({
|
||||||
projectRoot: './fixtures/static-build-code-component/',
|
projectRoot: './fixtures/static-build-code-component/',
|
||||||
renderers: [],
|
renderers: [],
|
||||||
buildOptions: {
|
buildOptions: {
|
||||||
experimentalStaticBuild: true,
|
experimentalStaticBuild: true,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
await fixture.build();
|
await fixture.build();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue