@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 +12 -14
- package/dist/index.js +448 -339
- package/dist/index.js.map +1 -1
- package/package.json +8 -21
- package/src/handle-hot-update.ts +24 -24
- package/src/index.ts +23 -24
- package/src/preprocess.ts +114 -0
- package/src/utils/compile.ts +71 -23
- package/src/utils/id.ts +55 -3
- package/src/utils/load-raw.ts +132 -0
- package/src/utils/options.ts +16 -9
- package/src/utils/preprocess.ts +9 -150
- package/dist/index.cjs +0 -2226
- package/dist/index.cjs.map +0 -1
- package/src/utils/__tests__/sourcemap.spec.ts +0 -25
- package/src/utils/sourcemap.ts +0 -58
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
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
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 };
|