config-vite.test.js — astro Source File
Architecture documentation for config-vite.test.js, a javascript file in the astro codebase. 8 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 907a60bf_69fe_d95c_3a20_8fdab5cd4035["config-vite.test.js"] 10ef2277_dd29_ec1c_ec39_152cc010052d["../dist/config/index.js"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> 10ef2277_dd29_ec1c_ec39_152cc010052d 0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15 dd4f09ce_3fd7_8295_f616_8876cda4555c["loadFixture"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> dd4f09ce_3fd7_8295_f616_8876cda4555c e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607 6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> 6b0635f9_51ea_77aa_767b_7857878e98a6 d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> d9a92db9_c95e_9165_13ac_24b3d859d946 deb87372_5629_35f8_9a54_e755a08f776a["cheerio"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> deb87372_5629_35f8_9a54_e755a08f776a 263e522e_1aa5_ebc3_e7d6_45ebc51671f7["vite"] 907a60bf_69fe_d95c_3a20_8fdab5cd4035 --> 263e522e_1aa5_ebc3_e7d6_45ebc51671f7 style 907a60bf_69fe_d95c_3a20_8fdab5cd4035 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { fileURLToPath } from 'node:url';
import * as cheerio from 'cheerio';
import { defaultClientConditions, resolveConfig } from 'vite';
import { getViteConfig } from '../dist/config/index.js';
import { loadFixture } from './test-utils.js';
describe('Vite Config', async () => {
let fixture;
before(async () => {
fixture = await loadFixture({
root: './fixtures/config-vite/',
// test suite was authored when inlineStylesheets defaulted to never
build: { inlineStylesheets: 'never' },
});
await fixture.build();
});
it('Allows overriding bundle naming options in the build', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
assert.match($('link').attr('href'), /\/assets\/testing-(.)+\.css/);
});
});
describe('getViteConfig', () => {
let originalCwd;
before(() => {
originalCwd = process.cwd();
// We chdir because otherwise it sets the wrong root in the site config
process.chdir(fileURLToPath(new URL('./fixtures/config-vite/', import.meta.url)));
});
it('Does not change the default config.', async () => {
const command = 'serve';
const mode = 'test';
const configFn = getViteConfig({}, { logLevel: 'silent' });
const config = await configFn({ command, mode });
const resolvedConfig = await resolveConfig(config, command, mode);
assert.deepStrictEqual(resolvedConfig.resolve.conditions, [
...defaultClientConditions,
'astro',
]);
});
after(() => {
process.chdir(originalCwd);
});
});
Domain
Dependencies
- ../dist/config/index.js
- cheerio
- loadFixture
- node:test
- node:url
- strict
- test-utils.js
- vite
Source
Frequently Asked Questions
What does config-vite.test.js do?
config-vite.test.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain.
What does config-vite.test.js depend on?
config-vite.test.js imports 8 module(s): ../dist/config/index.js, cheerio, loadFixture, node:test, node:url, strict, test-utils.js, vite.
Where is config-vite.test.js in the architecture?
config-vite.test.js is located at packages/astro/test/config-vite.test.js (domain: IntegrationAdapters, directory: packages/astro/test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free