@sveltejs/vite-plugin-svelte 1.3.1 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
+ import * as vite from 'vite';
1
2
  import { UserConfig, Plugin } from 'vite';
2
3
  import { CompileOptions, Warning } from 'svelte/types/compiler/interfaces';
3
4
  export { CompileOptions, Warning } from 'svelte/types/compiler/interfaces';
4
5
  import { PreprocessorGroup } from 'svelte/types/compiler/preprocess';
5
6
  export { MarkupPreprocessor, Preprocessor, PreprocessorGroup, Processed } from 'svelte/types/compiler/preprocess';
6
7
 
7
- declare type Options = Omit<SvelteOptions, 'vitePlugin'> & PluginOptionsInline;
8
+ type Options = Omit<SvelteOptions, 'vitePlugin'> & PluginOptionsInline;
8
9
  interface PluginOptionsInline extends PluginOptions {
9
10
  /**
10
11
  * Path to a svelte config file, either absolute or relative to Vite root
@@ -132,14 +133,6 @@ interface ExperimentalOptions {
132
133
  * @default false
133
134
  */
134
135
  useVitePreprocess?: boolean;
135
- /**
136
- * If a preprocessor does not provide a sourcemap, a best-effort fallback sourcemap will be provided.
137
- * This option requires `diff-match-patch` to be installed as a peer dependency.
138
- *
139
- * @see https://github.com/google/diff-match-patch
140
- * @default false
141
- */
142
- generateMissingPreprocessorSourcemaps?: boolean;
143
136
  /**
144
137
  * A function to update `compilerOptions` before compilation
145
138
  *
@@ -248,13 +241,18 @@ interface InspectorOptions {
248
241
  */
249
242
  appendTo?: string;
250
243
  }
251
- declare type ModuleFormat = NonNullable<CompileOptions['format']>;
252
- declare type CssHashGetter = NonNullable<CompileOptions['cssHash']>;
253
- declare type Arrayable<T> = T | T[];
244
+ type ModuleFormat = NonNullable<CompileOptions['format']>;
245
+ type CssHashGetter = NonNullable<CompileOptions['cssHash']>;
246
+ type Arrayable<T> = T | T[];
247
+
248
+ declare function vitePreprocess(opts?: {
249
+ script?: boolean;
250
+ style?: boolean | vite.InlineConfig | vite.ResolvedConfig;
251
+ }): PreprocessorGroup;
254
252
 
255
253
  declare function loadSvelteConfig(viteConfig?: UserConfig, inlineOptions?: Partial<Options>): Promise<Partial<SvelteOptions> | undefined>;
256
254
 
257
- declare type SvelteWarningsMessage = {
255
+ type SvelteWarningsMessage = {
258
256
  id: string;
259
257
  filename: string;
260
258
  normalizedFilename: string;
@@ -266,4 +264,4 @@ declare type SvelteWarningsMessage = {
266
264
 
267
265
  declare function svelte(inlineOptions?: Partial<Options>): Plugin[];
268
266
 
269
- export { Arrayable, CssHashGetter, ModuleFormat, Options, PluginOptions, SvelteOptions, SvelteWarningsMessage, loadSvelteConfig, svelte };
267
+ export { Arrayable, CssHashGetter, ModuleFormat, Options, PluginOptions, SvelteOptions, SvelteWarningsMessage, loadSvelteConfig, svelte, vitePreprocess };