@@ -133,6 +133,25 @@ export default function createConfig(opts: Partial<CreateConfigOptions>): InputO
133133 const pkg = getPackageJSON ( ) ;
134134 const hash = minify ? hashREADME ( ) : "" ;
135135 const output_dir = opts . outDir || "dist" ;
136+ const svelte : Partial < RollupPluginSvelteOptions > = {
137+ compilerOptions : {
138+ dev : DEV ,
139+ immutable : true ,
140+ } ,
141+ extensions : [ ".svelte" , ".md" ] ,
142+ preprocess : [ preprocessReadme ( { ...pkg , prefixUrl : opts . prefixUrl } ) ] ,
143+ } ;
144+
145+ if ( opts . svelte ?. compilerOptions ) {
146+ svelte . compilerOptions = {
147+ ...svelte . compilerOptions ,
148+ ...opts . svelte . compilerOptions ,
149+ } ;
150+ }
151+
152+ if ( opts . svelte ?. extensions ) {
153+ svelte . extensions = [ ...svelte . extensions ! , ...opts . svelte . extensions ] ;
154+ }
136155
137156 console . log ( `[createConfig] Running in ${ DEV ? "development" : "production" } ` ) ;
138157 console . log ( "[createConfig] options:" ) ;
@@ -193,11 +212,7 @@ export default function createConfig(opts: Partial<CreateConfigOptions>): InputO
193212 const app = new App({ target: document.body });
194213 export default app;` ,
195214 } ) ,
196- rollupPluginSvelte ( {
197- ...( opts . svelte || { } ) ,
198- extensions : [ ".svelte" , ".md" ] ,
199- preprocess : [ preprocessReadme ( { ...pkg , prefixUrl : opts . prefixUrl } ) ] ,
200- } ) ,
215+ rollupPluginSvelte ( svelte ) ,
201216 resolve ( ) ,
202217 ...( opts . plugins || [ ] ) ,
203218 minify && terser ( ) ,
0 commit comments