Home / File/ _config.js — svelte Source File

_config.js — svelte Source File

Architecture documentation for _config.js, a javascript file in the svelte codebase. 3 imports, 0 dependents.

File javascript BuildSystem QualityControl 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  f321d128_db1d_f0cc_225a_6e30204d65b5["_config.js"]
  032186a9_8a8b_b603_4335_6ade22d767cb["test.ts"]
  f321d128_db1d_f0cc_225a_6e30204d65b5 --> 032186a9_8a8b_b603_4335_6ade22d767cb
  740dc682_957b_322a_475e_aac0e8ee02bc["helpers.js"]
  f321d128_db1d_f0cc_225a_6e30204d65b5 --> 740dc682_957b_322a_475e_aac0e8ee02bc
  eef1adf9_5234_9bd1_1658_7e9636867c91["magic_string_bundle"]
  f321d128_db1d_f0cc_225a_6e30204d65b5 --> eef1adf9_5234_9bd1_1658_7e9636867c91
  style f321d128_db1d_f0cc_225a_6e30204d65b5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { test } from '../../test';
import { magic_string_bundle } from '../../helpers.js';

export const component_filepath = 'src/input.svelte';

export const component_file_basename = 'input.svelte';

// as output by external tool for src/external_code.css (relative to src/input.svelte)
export const external_relative_filename = 'external_code.css';

const external_code = `
span {
	--external_code-var: 1px;
}
`;

export default test({
	css_map_sources: [external_relative_filename],
	preprocess: [
		{
			style: ({ content, filename = '' }) => {
				const external = `/* Filename from preprocess: ${filename} */` + external_code;
				return magic_string_bundle([
					{ code: external, filename: external_relative_filename },
					{ code: content, filename }
				]);
			}
		}
	],
	options: {
		filename: component_filepath
	},
	client: [],
	preprocessed: ['Hello world'],
	test({ assert, code_preprocessed, map_preprocessed }) {
		assert.include(
			code_preprocessed,
			`/* Filename from preprocess: ${component_filepath} */`,
			'Preprocessor should receive same value for filename as passed to preprocess function'
		);

		assert.deepEqual(
			map_preprocessed.sources.slice().sort(),
			[external_relative_filename, component_file_basename].sort(),
			'Preprocessed map should contain sources relative to filepath'
		);
	}
});

Domain

Subdomains

Functions

Frequently Asked Questions

What does _config.js do?
_config.js is a source file in the svelte codebase, written in javascript. It belongs to the BuildSystem domain, QualityControl subdomain.
What functions are defined in _config.js?
_config.js defines 1 function(s): default.test.
What does _config.js depend on?
_config.js imports 3 module(s): helpers.js, magic_string_bundle, test.ts.
Where is _config.js in the architecture?
_config.js is located at packages/svelte/tests/sourcemaps/samples/sourcemap-basename/_config.js (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte/tests/sourcemaps/samples/sourcemap-basename).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free