MCPcopy
hub / github.com/sveltejs/svelte-preprocess / script

Function script

src/processors/coffeescript.ts:8–37  ·  view source on GitHub ↗
(svelteFile)

Source from the content-addressed store, hash-verified

6
7const coffeescript = (options?: Options.Coffeescript): PreprocessorGroup => ({
8 async script(svelteFile) {
9 const { transformer } = await import('../transformers/coffeescript.js');
10
11 let { content, filename, attributes, lang, dependencies } =
12 await getTagInfo(svelteFile);
13
14 if (lang !== 'coffeescript') {
15 return { code: content };
16 }
17
18 content = prepareContent({
19 options: {
20 ...options,
21 stripIndent: true,
22 },
23 content,
24 });
25
26 const transformed = await transformer({
27 content,
28 filename,
29 attributes,
30 options,
31 });
32
33 return {
34 ...transformed,
35 dependencies: concat(dependencies, transformed.dependencies),
36 };
37 },
38});
39
40// both for backwards compat with old svelte-preprocess versions

Callers

nothing calls this directly

Calls 4

getTagInfoFunction · 0.90
prepareContentFunction · 0.90
concatFunction · 0.90
transformerFunction · 0.50

Tested by

no test coverage detected