mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
466 B
27 lines
466 B
4 years ago
|
import * as ts from 'typescript';
|
||
|
|
||
|
export default {
|
||
|
js_map_sources: [
|
||
|
'input.svelte'
|
||
|
],
|
||
|
preprocess: [
|
||
|
{
|
||
|
script: ({ content, filename }) => {
|
||
|
const { outputText, sourceMapText } = ts.transpileModule(content, {
|
||
|
fileName: filename,
|
||
|
compilerOptions: {
|
||
|
target: ts.ScriptTarget.ES2015,
|
||
|
module: ts.ModuleKind.ES2015,
|
||
|
sourceMap: true
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return {
|
||
|
code: outputText,
|
||
|
map: sourceMapText
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
};
|