@sveltejs/vite-plugin-svelte 1.0.0-next.41 → 1.0.0-next.42
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/README.md +5 -5
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/utils/hash.ts +1 -1
- package/src/utils/load-svelte-config.ts +3 -0
- package/src/utils/options.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/vite-plugin-svelte",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.42",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "dominikg",
|
|
6
6
|
"files": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/sveltejs/vite-plugin-svelte#readme",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@rollup/pluginutils": "^4.2.
|
|
43
|
+
"@rollup/pluginutils": "^4.2.1",
|
|
44
44
|
"debug": "^4.3.4",
|
|
45
45
|
"kleur": "^4.1.4",
|
|
46
46
|
"magic-string": "^0.26.1",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"@types/debug": "^4.1.7",
|
|
61
61
|
"@types/diff-match-patch": "^1.0.32",
|
|
62
62
|
"diff-match-patch": "^1.0.5",
|
|
63
|
-
"esbuild": "^0.14.
|
|
64
|
-
"rollup": "^2.70.
|
|
65
|
-
"svelte": "^3.
|
|
66
|
-
"tsup": "^5.12.
|
|
67
|
-
"vite": "^2.9.
|
|
63
|
+
"esbuild": "^0.14.36",
|
|
64
|
+
"rollup": "^2.70.2",
|
|
65
|
+
"svelte": "^3.47.0",
|
|
66
|
+
"tsup": "^5.12.5",
|
|
67
|
+
"vite": "^2.9.5"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"dev": "pnpm run build:ci -- --sourcemap --watch src",
|
|
71
71
|
"build:ci": "rimraf dist && tsup-node src/index.ts --format esm,cjs --no-splitting --target node14",
|
|
72
72
|
"build": "pnpm run build:ci -- --dts --sourcemap"
|
|
73
73
|
},
|
|
74
|
-
"readme": "# @sveltejs/vite-plugin-svelte\n\nThe official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev).\n\n## Usage\n\n```js\n// vite.config.js\nimport { defineConfig } from 'vite';\nimport { svelte } from '@sveltejs/vite-plugin-svelte';\n\nexport default defineConfig({\n
|
|
74
|
+
"readme": "# @sveltejs/vite-plugin-svelte\n\nThe official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev).\n\n## Usage\n\n```js\n// vite.config.js\nimport { defineConfig } from 'vite';\nimport { svelte } from '@sveltejs/vite-plugin-svelte';\n\nexport default defineConfig({\n plugins: [\n svelte({\n /* plugin options */\n })\n ]\n});\n```\n\n## Documentation\n\n- [Plugin options](../../docs/config.md)\n- [FAQ](../../docs/faq.md)\n\n## License\n\n[MIT](./LICENSE)\n"
|
|
75
75
|
}
|
package/src/utils/hash.ts
CHANGED
|
@@ -14,7 +14,7 @@ export function safeBase64Hash(input: string) {
|
|
|
14
14
|
// OR DON'T USE A HASH AT ALL, what about a simple counter?
|
|
15
15
|
const md5 = crypto.createHash('md5');
|
|
16
16
|
md5.update(input);
|
|
17
|
-
const hash = toSafe(md5.digest('base64')).
|
|
17
|
+
const hash = toSafe(md5.digest('base64')).slice(0, hash_length);
|
|
18
18
|
hashes[input] = hash;
|
|
19
19
|
return hash;
|
|
20
20
|
}
|
|
@@ -29,6 +29,9 @@ export async function loadSvelteConfig(
|
|
|
29
29
|
viteConfig: UserConfig,
|
|
30
30
|
inlineOptions: Partial<Options>
|
|
31
31
|
): Promise<Partial<Options> | undefined> {
|
|
32
|
+
if (inlineOptions.configFile === false) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
32
35
|
const configFile = findConfigToLoad(viteConfig, inlineOptions);
|
|
33
36
|
if (configFile) {
|
|
34
37
|
let err;
|
package/src/utils/options.ts
CHANGED
|
@@ -355,9 +355,11 @@ export interface Options {
|
|
|
355
355
|
/**
|
|
356
356
|
* Path to a svelte config file, either absolute or relative to Vite root
|
|
357
357
|
*
|
|
358
|
+
* set to `false` to skip reading config from a file
|
|
359
|
+
*
|
|
358
360
|
* @see https://vitejs.dev/config/#root
|
|
359
361
|
*/
|
|
360
|
-
configFile?: string;
|
|
362
|
+
configFile?: string | false;
|
|
361
363
|
|
|
362
364
|
/**
|
|
363
365
|
* A `picomatch` pattern, or array of patterns, which specifies the files the plugin should
|