vite 2.7.0-beta.9 → 2.7.3
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/CHANGELOG.md +99 -29
- package/dist/node/build.d.ts +200 -0
- package/dist/node/chunks/{dep-9aea22f6.js → dep-5496817b.js} +280 -110
- package/dist/node/chunks/dep-5496817b.js.map +1 -0
- package/dist/node/chunks/{dep-ff5fc8ed.js → dep-66abeb03.js} +2 -2
- package/dist/node/chunks/{dep-ff5fc8ed.js.map → dep-66abeb03.js.map} +1 -1
- package/dist/node/chunks/{dep-f90ad7ac.js → dep-cf2decec.js} +2 -2
- package/dist/node/chunks/{dep-f90ad7ac.js.map → dep-cf2decec.js.map} +1 -1
- package/dist/node/chunks/{dep-a2051654.js → dep-df937e9b.js} +2 -2
- package/dist/node/chunks/{dep-a2051654.js.map → dep-df937e9b.js.map} +1 -1
- package/dist/node/cli.d.ts +1 -0
- package/dist/node/cli.js +4 -4
- package/dist/node/cli.js.map +1 -1
- package/dist/node/config.d.ts +202 -0
- package/dist/node/constants.d.ts +33 -0
- package/dist/node/http.d.ts +84 -0
- package/dist/node/importGlob.d.ts +9 -0
- package/dist/node/index.d.ts +280 -280
- package/dist/node/index.js +1 -1
- package/dist/node/logger.d.ts +35 -0
- package/dist/node/optimizer/esbuildDepPlugin.d.ts +4 -0
- package/dist/node/optimizer/index.d.ts +66 -0
- package/dist/node/optimizer/registerMissing.d.ts +2 -0
- package/dist/node/optimizer/scan.d.ts +9 -0
- package/dist/node/packages.d.ts +25 -0
- package/dist/node/plugin.d.ts +115 -0
- package/dist/node/plugins/asset.d.ts +40 -0
- package/dist/node/plugins/assetImportMetaUrl.d.ts +13 -0
- package/dist/node/plugins/clientInjections.d.ts +7 -0
- package/dist/node/plugins/css.d.ts +72 -0
- package/dist/node/plugins/dataUri.d.ts +5 -0
- package/dist/node/plugins/define.d.ts +3 -0
- package/dist/node/plugins/esbuild.d.ts +15 -0
- package/dist/node/plugins/html.d.ts +102 -0
- package/dist/node/plugins/importAnalysis.d.ts +46 -0
- package/dist/node/plugins/importAnalysisBuild.d.ts +15 -0
- package/dist/node/plugins/index.d.ts +3 -0
- package/dist/node/plugins/json.d.ts +22 -0
- package/dist/node/plugins/loadFallback.d.ts +5 -0
- package/dist/node/plugins/manifest.d.ts +14 -0
- package/dist/node/plugins/modulePreloadPolyfill.d.ts +4 -0
- package/dist/node/plugins/preAlias.d.ts +5 -0
- package/dist/node/plugins/reporter.d.ts +3 -0
- package/dist/node/plugins/resolve.d.ts +38 -0
- package/dist/node/plugins/ssrRequireHook.d.ts +12 -0
- package/dist/node/plugins/terser.d.ts +3 -0
- package/dist/node/plugins/wasm.d.ts +3 -0
- package/dist/node/plugins/worker.d.ts +3 -0
- package/dist/node/preview.d.ts +31 -0
- package/dist/node/server/hmr.d.ts +37 -0
- package/dist/node/server/index.d.ts +214 -0
- package/dist/node/server/middlewares/base.d.ts +3 -0
- package/dist/node/server/middlewares/error.d.ts +8 -0
- package/dist/node/server/middlewares/indexHtml.d.ts +4 -0
- package/dist/node/server/middlewares/proxy.d.ts +20 -0
- package/dist/node/server/middlewares/spaFallback.d.ts +2 -0
- package/dist/node/server/middlewares/static.d.ts +6 -0
- package/dist/node/server/middlewares/time.d.ts +2 -0
- package/dist/node/server/middlewares/transform.d.ts +3 -0
- package/dist/node/server/moduleGraph.d.ts +53 -0
- package/dist/node/server/openBrowser.d.ts +15 -0
- package/dist/node/server/pluginContainer.d.ts +37 -0
- package/dist/node/server/searchRoot.d.ts +8 -0
- package/dist/node/server/send.d.ts +4 -0
- package/dist/node/server/sourcemap.d.ts +8 -0
- package/dist/node/server/transformRequest.d.ts +14 -0
- package/dist/node/server/ws.d.ts +14 -0
- package/dist/node/ssr/ssrExternal.d.ts +7 -0
- package/dist/node/ssr/ssrManifestPlugin.d.ts +3 -0
- package/dist/node/ssr/ssrModuleLoader.d.ts +7 -0
- package/dist/node/ssr/ssrStacktrace.d.ts +3 -0
- package/dist/node/ssr/ssrTransform.d.ts +8 -0
- package/dist/node/utils.d.ts +114 -0
- package/package.json +5 -5
- package/types/ws.d.ts +277 -281
- package/dist/node/chunks/dep-9aea22f6.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
+
## [2.7.3](https://github.com/vitejs/vite/compare/v2.7.2...v2.7.3) (2021-12-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* do not overwrite rollupOptions.input in dev ([#6025](https://github.com/vitejs/vite/issues/6025)) ([6cdf13a](https://github.com/vitejs/vite/commit/6cdf13ae808a99b7aca6d278bee2ebe6e51d0846))
|
|
7
|
+
* Improve post-build asset update check ([#6113](https://github.com/vitejs/vite/issues/6113)) ([611fa03](https://github.com/vitejs/vite/commit/611fa037a72a1179c27794353ffad6ed27e10d1a))
|
|
8
|
+
* improve warning message for malformed packages ([#6086](https://github.com/vitejs/vite/issues/6086)) ([717cb08](https://github.com/vitejs/vite/commit/717cb08f8611fd1a15cfd614d346185ffe8a61fd))
|
|
9
|
+
* pending reload never timeout ([#6120](https://github.com/vitejs/vite/issues/6120)) ([e002f4f](https://github.com/vitejs/vite/commit/e002f4f4a578ae63156e756abac0487f42b4cdcd))
|
|
10
|
+
* respect new port when change the config file ([#6075](https://github.com/vitejs/vite/issues/6075)) ([3ceffcc](https://github.com/vitejs/vite/commit/3ceffcca66311f9a7d71612a596b84888c3f843b))
|
|
11
|
+
* **ssr:** robust regexp to check cjs content ([#6053](https://github.com/vitejs/vite/issues/6053)) ([0373441](https://github.com/vitejs/vite/commit/03734417cde10807ab2dd0d71b08c26081aac0b7))
|
|
12
|
+
* terminate WebSocket connections before closing WebSocket server ([#6115](https://github.com/vitejs/vite/issues/6115)) ([b9871bb](https://github.com/vitejs/vite/commit/b9871bbed57c5964b3393e798b0ef2526471d692))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [2.7.2](https://github.com/vitejs/vite/compare/v2.7.1...v2.7.2) (2021-12-13)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **html:** empty script ([#6057](https://github.com/vitejs/vite/issues/6057)) ([1487223](https://github.com/vitejs/vite/commit/1487223f39b7555b1050b660d847eabf4d20249f))
|
|
22
|
+
* **lexGlobPattern:** edge case of glob import ([#6022](https://github.com/vitejs/vite/issues/6022)) ([d4c5cff](https://github.com/vitejs/vite/commit/d4c5cff551ad9fb721243f8abdbf0c78f5b5a7ec))
|
|
23
|
+
* ws types ([#6083](https://github.com/vitejs/vite/issues/6083)) ([1ded1a8](https://github.com/vitejs/vite/commit/1ded1a835bfb64f2c70c8c153e979b7911c9a8c1))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## [2.7.1](https://github.com/vitejs/vite/compare/v2.7.0...v2.7.1) (2021-12-07)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **ssr:** `ssrTransform` handling for empty ArrayPattern ([#5988](https://github.com/vitejs/vite/issues/5988)) ([79aa687](https://github.com/vitejs/vite/commit/79aa68744cf17553448bce5c175a25f785e4a743))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# [2.7.0](https://github.com/vitejs/vite/compare/v2.7.0-beta.11...v2.7.0) (2021-12-07)
|
|
37
|
+
|
|
38
|
+
- 🎉 Revamped SSR dependency handling
|
|
39
|
+
- 🧩 API consolidation
|
|
40
|
+
- 🛑 server.fs.strict by default
|
|
41
|
+
|
|
42
|
+
### BREAKING CHANGES
|
|
43
|
+
|
|
44
|
+
- `server.fs.strict` is `true` by default ([#5341](https://github.com/vitejs/vite/pull/5341))
|
|
45
|
+
See [server filesystem restriction docs](https://vitejs.dev/config/#server-fs-strict) for more details.
|
|
46
|
+
- Plugin hooks `ssr` param to object in `resolveId`, `load`, and `transform` ([#5253](https://github.com/vitejs/vite/pull/5253))
|
|
47
|
+
Previous to this release, the `ssr` param was passed as a `boolean` in the last parameter of each hook. The new interface for these hooks is now:
|
|
48
|
+
```ts
|
|
49
|
+
export interface Plugin extends RollupPlugin {
|
|
50
|
+
// ... other hooks
|
|
51
|
+
resolveId?(this: PluginContext, source: string, importer: string | undefined, options: {
|
|
52
|
+
custom?: CustomPluginOptions;
|
|
53
|
+
ssr?: boolean;
|
|
54
|
+
}): Promise<ResolveIdResult> | ResolveIdResult;
|
|
55
|
+
load?(this: PluginContext, id: string, options?: {
|
|
56
|
+
ssr?: boolean;
|
|
57
|
+
}): Promise<LoadResult> | LoadResult;
|
|
58
|
+
transform?(this: TransformPluginContext, code: string, id: string, options?: {
|
|
59
|
+
ssr?: boolean;
|
|
60
|
+
}): Promise<TransformResult> | TransformResult;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
In your plugins, you can check if the last param is a boolean or an object to be backward compatible with 2.6 and give some time to users to migrate to Vite 2.7.
|
|
64
|
+
- `server.pluginContainer` options object for `resolveId`, `load`, and `transform` ([#5294](https://github.com/vitejs/vite/pull/5294))
|
|
65
|
+
- Normalize scripts and commands naming ([#5207](https://github.com/vitejs/vite/pull/5207))
|
|
66
|
+
Adds a new `vite dev` command alias for `vite serve`, preparing for the new release of create-vite where package scripts are renamed to `dev`, `build`, and `preview`.
|
|
67
|
+
- Align experimental `preview` api ([#5407](https://github.com/vitejs/vite/pull/5407))
|
|
68
|
+
This API was first introduced in 2.6 and it is still in flux.
|
|
69
|
+
- resolve `rollupOptions.input` paths ([#5601](https://github.com/vitejs/vite/pull/5601))
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
* expose `ssrTransform` to server ([#5983](https://github.com/vitejs/vite/issues/5983)) ([8184feb](https://github.com/vitejs/vite/commit/8184feba29c6a89d58bc4437977d22658e946e0c))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# [2.7.0-beta.11](https://github.com/vitejs/vite/compare/v2.7.0-beta.10...v2.7.0-beta.11) (2021-12-06)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### Bug Fixes
|
|
81
|
+
|
|
82
|
+
* **ssr:** allow primitive default exports and forwarded exports ([#5973](https://github.com/vitejs/vite/issues/5973)) ([a47b663](https://github.com/vitejs/vite/commit/a47b663ad06af8c5bf87128035f6b112de0ecd16))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# [2.7.0-beta.10](https://github.com/vitejs/vite/compare/v2.7.0-beta.9...v2.7.0-beta.10) (2021-12-02)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Bug Fixes
|
|
90
|
+
|
|
91
|
+
* invalidate inlined proxy scripts on change ([#5891](https://github.com/vitejs/vite/issues/5891)) ([5b8c58b](https://github.com/vitejs/vite/commit/5b8c58bf9d2fe141cea9bde9492ccbedf9b76213))
|
|
92
|
+
* read the correct package.json in ssrExternal ([#5927](https://github.com/vitejs/vite/issues/5927)) ([7edabb4](https://github.com/vitejs/vite/commit/7edabb46de3ce63e078e0cda7cd3ed9e5cdd0f2a)), closes [#5890](https://github.com/vitejs/vite/issues/5890)
|
|
93
|
+
* **resolve:** dont overwrite `isRequire` from `baseOptions` ([#5872](https://github.com/vitejs/vite/issues/5872)) ([2b91e5a](https://github.com/vitejs/vite/commit/2b91e5aadaee0947eb9864367ae85762573a8dc4))
|
|
94
|
+
* **scan:** handle local scripts with lang=ts ([#5850](https://github.com/vitejs/vite/issues/5850)) ([7ed8702](https://github.com/vitejs/vite/commit/7ed870273206b5e9dcedda6f0149b7b3324dea45))
|
|
95
|
+
* SSR import in dev can't resolve default import (fix [#5706](https://github.com/vitejs/vite/issues/5706)) ([#5923](https://github.com/vitejs/vite/issues/5923)) ([21d79d7](https://github.com/vitejs/vite/commit/21d79d753af145f2c7ebb7dd5b0b1a4a298f96c5))
|
|
96
|
+
* **ssr:** skip dedupe require if noExternal true ([#5928](https://github.com/vitejs/vite/issues/5928)) ([f6aa7fe](https://github.com/vitejs/vite/commit/f6aa7fe401737ef584ccf34b6042a32b8e5e8c5d))
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
1
100
|
# [2.7.0-beta.9](https://github.com/vitejs/vite/compare/v2.7.0-beta.8...v2.7.0-beta.9) (2021-11-27)
|
|
2
101
|
|
|
3
102
|
|
|
@@ -128,35 +227,6 @@
|
|
|
128
227
|
|
|
129
228
|
# [2.7.0-beta.0](https://github.com/vitejs/vite/compare/v2.6.13...v2.7.0-beta.0) (2021-10-28)
|
|
130
229
|
|
|
131
|
-
|
|
132
|
-
### BREAKING CHANGES
|
|
133
|
-
|
|
134
|
-
- `server.fs.strict` is `true` by default ([#5341](https://github.com/vitejs/vite/pull/5341))
|
|
135
|
-
See [server filesystem restriction docs](https://vitejs.dev/config/#server-fs-strict) for more details.
|
|
136
|
-
- Plugin hooks `ssr` param to object in `resolveId`, `load`, and `transform` ([#5253](https://github.com/vitejs/vite/pull/5253))
|
|
137
|
-
Previous to this release, the `ssr` param was passed as a `boolean` in the last parameter of each hook. The new interface for these hooks is now:
|
|
138
|
-
```ts
|
|
139
|
-
export interface Plugin extends RollupPlugin {
|
|
140
|
-
// ... other hooks
|
|
141
|
-
resolveId?(this: PluginContext, source: string, importer: string | undefined, options: {
|
|
142
|
-
custom?: CustomPluginOptions;
|
|
143
|
-
ssr?: boolean;
|
|
144
|
-
}): Promise<ResolveIdResult> | ResolveIdResult;
|
|
145
|
-
load?(this: PluginContext, id: string, options?: {
|
|
146
|
-
ssr?: boolean;
|
|
147
|
-
}): Promise<LoadResult> | LoadResult;
|
|
148
|
-
transform?(this: TransformPluginContext, code: string, id: string, options?: {
|
|
149
|
-
ssr?: boolean;
|
|
150
|
-
}): Promise<TransformResult> | TransformResult;
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
In your plugins, you can check if the last param is a boolean or an object to be backward compatible with 2.6 and give some time to users to migrate to Vite 2.7.
|
|
154
|
-
- `server.pluginContainer` options object for `resolveId`, `load`, and `transform` ([#5294](https://github.com/vitejs/vite/pull/5294))
|
|
155
|
-
- Normalize scripts and commands naming ([#5207](https://github.com/vitejs/vite/pull/5207))
|
|
156
|
-
Adds a new `vite dev` command alias for `vite serve`, preparing for the new release of create-vite where package scripts are renamed to `dev`, `build`, and `preview`.
|
|
157
|
-
- Align experimental `preview` api ([#5407](https://github.com/vitejs/vite/pull/5407))
|
|
158
|
-
This API was first introduced in 2.6 and it is still in flux.
|
|
159
|
-
|
|
160
230
|
### Bug Fixes
|
|
161
231
|
|
|
162
232
|
* add `import` support to `ssrModuleLoader` ([#5197](https://github.com/vitejs/vite/issues/5197)) ([baba1f9](https://github.com/vitejs/vite/commit/baba1f9e8fb22254b3858bcc1ffe89b334736068))
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { InlineConfig, ResolvedConfig } from './config';
|
|
2
|
+
import { Plugin, RollupOptions, RollupWarning, WarningHandler, RollupOutput, WatcherOptions, RollupWatcher, ModuleFormat } from 'rollup';
|
|
3
|
+
import { Terser } from 'types/terser';
|
|
4
|
+
import { RollupCommonJSOptions } from 'types/commonjs';
|
|
5
|
+
import { RollupDynamicImportVarsOptions } from 'types/dynamicImportVars';
|
|
6
|
+
import { TransformOptions } from 'esbuild';
|
|
7
|
+
export interface BuildOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Base public path when served in production.
|
|
10
|
+
* @deprecated `base` is now a root-level config option.
|
|
11
|
+
*/
|
|
12
|
+
base?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Compatibility transform target. The transform is performed with esbuild
|
|
15
|
+
* and the lowest supported target is es2015/es6. Note this only handles
|
|
16
|
+
* syntax transformation and does not cover polyfills (except for dynamic
|
|
17
|
+
* import)
|
|
18
|
+
*
|
|
19
|
+
* Default: 'modules' - Similar to `@babel/preset-env`'s targets.esmodules,
|
|
20
|
+
* transpile targeting browsers that natively support dynamic es module imports.
|
|
21
|
+
* https://caniuse.com/es6-module-dynamic-import
|
|
22
|
+
*
|
|
23
|
+
* Another special value is 'esnext' - which only performs minimal transpiling
|
|
24
|
+
* (for minification compat) and assumes native dynamic imports support.
|
|
25
|
+
*
|
|
26
|
+
* For custom targets, see https://esbuild.github.io/api/#target and
|
|
27
|
+
* https://esbuild.github.io/content-types/#javascript for more details.
|
|
28
|
+
*/
|
|
29
|
+
target?: 'modules' | TransformOptions['target'] | false;
|
|
30
|
+
/**
|
|
31
|
+
* whether to inject module preload polyfill.
|
|
32
|
+
* Note: does not apply to library mode.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
polyfillModulePreload?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* whether to inject dynamic import polyfill.
|
|
38
|
+
* Note: does not apply to library mode.
|
|
39
|
+
* @default false
|
|
40
|
+
* @deprecated use plugin-legacy for browsers that don't support dynamic import
|
|
41
|
+
*/
|
|
42
|
+
polyfillDynamicImport?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Directory relative from `root` where build output will be placed. If the
|
|
45
|
+
* directory exists, it will be removed before the build.
|
|
46
|
+
* @default 'dist'
|
|
47
|
+
*/
|
|
48
|
+
outDir?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Directory relative from `outDir` where the built js/css/image assets will
|
|
51
|
+
* be placed.
|
|
52
|
+
* @default 'assets'
|
|
53
|
+
*/
|
|
54
|
+
assetsDir?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Static asset files smaller than this number (in bytes) will be inlined as
|
|
57
|
+
* base64 strings. Default limit is `4096` (4kb). Set to `0` to disable.
|
|
58
|
+
* @default 4096
|
|
59
|
+
*/
|
|
60
|
+
assetsInlineLimit?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to code-split CSS. When enabled, CSS in async chunks will be
|
|
63
|
+
* inlined as strings in the chunk and inserted via dynamically created
|
|
64
|
+
* style tags when the chunk is loaded.
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
cssCodeSplit?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* An optional separate target for CSS minification.
|
|
70
|
+
* As esbuild only supports configuring targets to mainstream
|
|
71
|
+
* browsers, users may need this option when they are targeting
|
|
72
|
+
* a niche browser that comes with most modern JavaScript features
|
|
73
|
+
* but has poor CSS support, e.g. Android WeChat WebView, which
|
|
74
|
+
* doesn't support the #RGBA syntax.
|
|
75
|
+
*/
|
|
76
|
+
cssTarget?: TransformOptions['target'] | false;
|
|
77
|
+
/**
|
|
78
|
+
* If `true`, a separate sourcemap file will be created. If 'inline', the
|
|
79
|
+
* sourcemap will be appended to the resulting output file as data URI.
|
|
80
|
+
* 'hidden' works like `true` except that the corresponding sourcemap
|
|
81
|
+
* comments in the bundled files are suppressed.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
sourcemap?: boolean | 'inline' | 'hidden';
|
|
85
|
+
/**
|
|
86
|
+
* Set to `false` to disable minification, or specify the minifier to use.
|
|
87
|
+
* Available options are 'terser' or 'esbuild'.
|
|
88
|
+
* @default 'esbuild'
|
|
89
|
+
*/
|
|
90
|
+
minify?: boolean | 'terser' | 'esbuild';
|
|
91
|
+
/**
|
|
92
|
+
* Options for terser
|
|
93
|
+
* https://terser.org/docs/api-reference#minify-options
|
|
94
|
+
*/
|
|
95
|
+
terserOptions?: Terser.MinifyOptions;
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated Vite now uses esbuild for CSS minification.
|
|
98
|
+
*/
|
|
99
|
+
cleanCssOptions?: any;
|
|
100
|
+
/**
|
|
101
|
+
* Will be merged with internal rollup options.
|
|
102
|
+
* https://rollupjs.org/guide/en/#big-list-of-options
|
|
103
|
+
*/
|
|
104
|
+
rollupOptions?: RollupOptions;
|
|
105
|
+
/**
|
|
106
|
+
* Options to pass on to `@rollup/plugin-commonjs`
|
|
107
|
+
*/
|
|
108
|
+
commonjsOptions?: RollupCommonJSOptions;
|
|
109
|
+
/**
|
|
110
|
+
* Options to pass on to `@rollup/plugin-dynamic-import-vars`
|
|
111
|
+
*/
|
|
112
|
+
dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
|
|
113
|
+
/**
|
|
114
|
+
* Whether to write bundle to disk
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
write?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Empty outDir on write.
|
|
120
|
+
* @default true when outDir is a sub directory of project root
|
|
121
|
+
*/
|
|
122
|
+
emptyOutDir?: boolean | null;
|
|
123
|
+
/**
|
|
124
|
+
* Whether to emit a manifest.json under assets dir to map hash-less filenames
|
|
125
|
+
* to their hashed versions. Useful when you want to generate your own HTML
|
|
126
|
+
* instead of using the one generated by Vite.
|
|
127
|
+
*
|
|
128
|
+
* Example:
|
|
129
|
+
*
|
|
130
|
+
* ```json
|
|
131
|
+
* {
|
|
132
|
+
* "main.js": {
|
|
133
|
+
* "file": "main.68fe3fad.js",
|
|
134
|
+
* "css": "main.e6b63442.css",
|
|
135
|
+
* "imports": [...],
|
|
136
|
+
* "dynamicImports": [...]
|
|
137
|
+
* }
|
|
138
|
+
* }
|
|
139
|
+
* ```
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
142
|
+
manifest?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Build in library mode. The value should be the global name of the lib in
|
|
145
|
+
* UMD mode. This will produce esm + cjs + umd bundle formats with default
|
|
146
|
+
* configurations that are suitable for distributing libraries.
|
|
147
|
+
*/
|
|
148
|
+
lib?: LibraryOptions | false;
|
|
149
|
+
/**
|
|
150
|
+
* Produce SSR oriented build. Note this requires specifying SSR entry via
|
|
151
|
+
* `rollupOptions.input`.
|
|
152
|
+
*/
|
|
153
|
+
ssr?: boolean | string;
|
|
154
|
+
/**
|
|
155
|
+
* Generate SSR manifest for determining style links and asset preload
|
|
156
|
+
* directives in production.
|
|
157
|
+
*/
|
|
158
|
+
ssrManifest?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Set to false to disable reporting compressed chunk sizes.
|
|
161
|
+
* Can slightly improve build speed.
|
|
162
|
+
*/
|
|
163
|
+
reportCompressedSize?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Set to false to disable brotli compressed size reporting for build.
|
|
166
|
+
* Can slightly improve build speed.
|
|
167
|
+
* @deprecated use `build.reportCompressedSize` instead.
|
|
168
|
+
*/
|
|
169
|
+
brotliSize?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Adjust chunk size warning limit (in kbs).
|
|
172
|
+
* @default 500
|
|
173
|
+
*/
|
|
174
|
+
chunkSizeWarningLimit?: number;
|
|
175
|
+
/**
|
|
176
|
+
* Rollup watch options
|
|
177
|
+
* https://rollupjs.org/guide/en/#watchoptions
|
|
178
|
+
*/
|
|
179
|
+
watch?: WatcherOptions | null;
|
|
180
|
+
}
|
|
181
|
+
export interface LibraryOptions {
|
|
182
|
+
entry: string;
|
|
183
|
+
name?: string;
|
|
184
|
+
formats?: LibraryFormats[];
|
|
185
|
+
fileName?: string | ((format: ModuleFormat) => string);
|
|
186
|
+
}
|
|
187
|
+
export declare type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife';
|
|
188
|
+
export declare type ResolvedBuildOptions = Required<Omit<BuildOptions, 'base' | 'cleanCssOptions' | 'polyfillDynamicImport' | 'brotliSize'>>;
|
|
189
|
+
export declare function resolveBuildOptions(root: string, raw?: BuildOptions, isBuild?: boolean): ResolvedBuildOptions;
|
|
190
|
+
export declare function resolveBuildPlugins(config: ResolvedConfig): {
|
|
191
|
+
pre: Plugin[];
|
|
192
|
+
post: Plugin[];
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Bundles the app for production.
|
|
196
|
+
* Returns a Promise containing the build result.
|
|
197
|
+
*/
|
|
198
|
+
export declare function build(inlineConfig?: InlineConfig): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
|
|
199
|
+
export declare function resolveLibFilename(libOptions: LibraryOptions, format: ModuleFormat, root: string): string;
|
|
200
|
+
export declare function onRollupWarning(warning: RollupWarning, warn: WarningHandler, config: ResolvedConfig): void;
|