Skip to content

Latest commit

 

History

History
2950 lines (1605 loc) · 218 KB

CHANGELOG.md

File metadata and controls

2950 lines (1605 loc) · 218 KB

2.9.0-beta.0 (2022-03-09)

  • fix: import.meta.url should not throw (#7219) (5de3a98), closes #7219
  • fix: allow localhost as a valid hostname (#7092) (4194cce), closes #7092
  • fix: build optimize deps metada location (#7214) (dc46adf), closes #7214
  • fix: define plugin not ignore file names (#6340) (7215a03), closes #6340
  • fix: deprecate { assert: { type: raw }} in favor of { as: raw } (fix #7017) (#7215) (87ecce5), closes #7017 #7215
  • fix: execute classic worker in dev mode (#7099) (3c0a609), closes #7099
  • fix: handle files with multiple comments (#7202) (3f5b645), closes #7202
  • fix: honor the host param when creating a websocket server (#5617) (882c8a8), closes #5617
  • fix: import css in less/scss (fix 3293) (#7147) (9b51a3a), closes #7147
  • fix: optimizeDeps.include missing in known imports fallback (#7218) (6c08c86), closes #7218
  • fix: prevent loading env outside of root (#6995) (e0a4d81), closes #6995
  • fix: reoptimize deps on esbuild options change (#6855) (4517c2b), closes #6855
  • fix: replacing compression with modern version (#6557) (5648d09), closes #6557
  • fix: restart optimize (#7004) (47fbe29), closes #7004
  • fix: reusing variable names in html module scripts (fix #6851) (#6818) (c46b56d), closes #6851 #6818
  • fix: revert #6340, definePlugin tests, warning box (#7174) (6cb0647), closes #6340 #7174
  • fix: update postcss-load-config to load PostCSS plugins based on their config file path (#6856) (f02f961), closes #6856
  • fix(hmr): client pinging behind a proxy on websocket disconnect (fix #4501) (#5466) (96573db), closes #4501 #5466
  • fix(html): build mode ignore html define transform (#6663) (79dd003), closes #6663
  • fix(json): load json module error (#6352) (c8a7ea8), closes #6352
  • fix(optimizer): add missing keys to hash (#7189) (b0c0efe), closes #7189
  • fix(resolve): try .tsx extension for .js import from typescript module (#7005) (72b8cb6), closes #7005
  • fix(server): base middleware redirect with search and hash (#6574) (a516e85), closes #6574
  • fix(server): ensure consistency for url to file mapping in importAnalysis and static middleware (#65 (b214115), closes #6518
  • fix(ssr): bypass missing resolve error in SSR (#7164) (a4927c5), closes #7164
  • chore: replace SourceMapConsumer with trace-mapping (#6746) (ed4d191), closes #6746
  • feat: add importedCss and importedAssets to RenderedChunk type (#6629) (8d0fc90), closes #6629
  • feat: non-blocking pre bundling of dependencies (#6758) (24bb3e4), closes #6758
  • feat: optimize custom extensions (#6801) (c11af23), closes #6801
  • feat: show all prebundle deps when debug (#6726) (e626055), closes #6726
  • feat(config): hmr add disable port config (#6624) (ce07a0a), closes #6624
  • feat(glob): import.meta.glob support alias path (#6526) (86882ad), closes #6526
  • feat(perf): tsconfck perf improvement (#7055) (993ea39), closes #7055
  • feat(worker): bundle worker emit asset file (#6599) (0ade335), closes #6599
  • refactor: avoid splitting vendor chunk by default (#6534) (849e845), closes #6534

2.8.6 (2022-03-01)

Bug Fixes

2.8.5 (2022-02-28)

Bug Fixes

Features

2.8.4 (2022-02-18)

Bug Fixes

2.8.3 (2022-02-15)

Bug Fixes

2.8.2 (2022-02-14)

Features

Performance Improvements

2.8.1 (2022-02-11)

Bug Fixes

2.8.0 (2022-02-09)

Reduced Footprint

Vite 2.8.0 is almost 1/4 of the 2.7.0 publish size, and the install size has been reduced by 35%. See this thread about each change that reduced Vite's footprint.

Version Publish Size Install Size
2.7.0 12.7MB 25.2MB
2.8.0 4.6MB 17.4MB

Default preview port

New default port for vite preview is 4173 (avoid conflicts in MacOS that took over the 5000 port)

Workers using standard syntax

Workers are detected and bundled when using new URL('path', import.meta.url), replacing the need for the ?worker suffix and aligning Vite with standard patterns. See #6356. Instead of

import MyWorker from './worker.js?worker'
const worker = new MyWorker()

it is now recommended to use

const worker = new Worker(
  new URL('./worker.js', import.meta.url), { type: 'module' }
)

Configuring Workers Bundling

New worker config field adding support for Worker format, plugins and, rollupOptions. See #6351

  • worker.format: 'es' | 'iife'
    Output format for worker bundle (default: iife).
  • worker.plugins: (Plugin | Plugin[])[]
    Vite plugins that apply to worker bundle.
  • worker.rollupOptions: RollupOptions
    Rollup options to build worker bundle.

The worker plugins pipeline isn't shared with the main Vite pipeline, there may be plugins that shouldn't be applied to Workers. If a plugin must be applied to both the main build and the worker build, you need to add a plugin in the main plugins array and another one in the worker.plugins config.

import PluginX from 'vite-plugin-x'
export default {
  plugins: [ PluginX() ]
  worker: {
    format: 'es',
    plugins: [ PluginX() ]
  }
}

Raw Glob Imports

Glob imports now support the raw modifier (that works in the same way as the ?raw suffix in regular imports). Vite is going to gradually migrate to the new standard assert syntax instead of using custom URL suffixes where possible.

const examples = import.meta.globEager('./examples/*.html', { assert: { type: 'raw' }})
  • New server.headers config option allowing configuration of response headers in dev mode.
export default {
 server: {
    port: '8080',
    headers: {
      'Cache-Control': 'no-store'
    }
  },
}

Bug Fixes

Features

Beta Changelogs

2.8.0-beta.7 (2022-02-08)

See 2.8.0-beta.7 changelog

2.8.0-beta.6 (2022-02-07)

See 2.8.0-beta.6 changelog

2.8.0-beta.5 (2022-02-02)

See 2.8.0-beta.5 changelog

2.8.0-beta.4 (2022-01-31)

See 2.8.0-beta.4 changelog

2.8.0-beta.3 (2022-01-18)

See 2.8.0-beta.3 changelog

2.8.0-beta.2 (2022-01-13)

2.8.0-beta.2 changelog

2.8.0-beta.1 (2022-01-06)

See 2.8.0-beta.1 changelog

2.8.0-beta.0 (2022-01-05)

See 2.8.0-beta.0 changelog

2.7.9 (2021-12-28)

2.7.8 (2021-12-28)

Bug Fixes

  • html: show error overlay when parsing invalid file (#6184) (1f945f6)
  • seperate source and dep for dymamic import after build (#6251) (49da986)
  • ssr: capture scope declaration correctly (#6281) (60ce7f9)
  • upgrade to launch-editor with picocolors (#6209) (394539c)

2.7.7 (2021-12-26)

Bug Fixes

2.7.6 (2021-12-22)

Bug Fixes

  • remove virtual module prefix while generating manifest (#6225) (d51259b)

2.7.5 (2021-12-21)

Bug Fixes

2.7.4 (2021-12-20)

Bug Fixes

  • duplicate variable declaration caused by css modules (#5873) (8e16a78)
  • improve error message for HTML compilation error (fix #5769) (#5777) (79d1397)
  • ssr: ssrTransform function argument destructure (#6171) (2762a0e)

2.7.3 (2021-12-16)

Bug Fixes

  • do not overwrite rollupOptions.input in dev (#6025) (6cdf13a)
  • Improve post-build asset update check (#6113) (611fa03)
  • improve warning message for malformed packages (#6086) (717cb08)
  • pending reload never timeout (#6120) (e002f4f)
  • respect new port when change the config file (#6075) (3ceffcc)
  • ssr: robust regexp to check cjs content (#6053) (0373441)
  • terminate WebSocket connections before closing WebSocket server (#6115) (b9871bb)

2.7.2 (2021-12-13)

Bug Fixes

2.7.1 (2021-12-07)

Bug Fixes

  • ssr: ssrTransform handling for empty ArrayPattern (#5988) (79aa687)

2.7.0 (2021-12-07)

  • 🎉 Revamped SSR dependency handling
  • 🧩 API consolidation
  • 🛑 server.fs.strict by default

BREAKING CHANGES

  • server.fs.strict is true by default (#5341) See server filesystem restriction docs for more details.
  • Plugin hooks ssr param to object in resolveId, load, and transform (#5253) 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:
    export interface Plugin extends RollupPlugin {
      // ... other hooks
      resolveId?(this: PluginContext, source: string, importer: string | undefined, options: {
          custom?: CustomPluginOptions;
          ssr?: boolean;
      }): Promise<ResolveIdResult> | ResolveIdResult;
      load?(this: PluginContext, id: string, options?: {
          ssr?: boolean;
      }): Promise<LoadResult> | LoadResult;
      transform?(this: TransformPluginContext, code: string, id: string, options?: {
          ssr?: boolean;
      }): Promise<TransformResult> | TransformResult;
    }
    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.
  • server.pluginContainer options object for resolveId, load, and transform (#5294)
  • Normalize scripts and commands naming (#5207) 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.
  • Align experimental preview api (#5407) This API was first introduced in 2.6 and it is still in flux.
  • resolve rollupOptions.input paths (#5601)

Features

2.7.0-beta.11 (2021-12-06)

Bug Fixes

  • ssr: allow primitive default exports and forwarded exports (#5973) (a47b663)

2.7.0-beta.10 (2021-12-02)

Bug Fixes

2.7.0-beta.9 (2021-11-27)

Bug Fixes

Features

2.7.0-beta.8 (2021-11-19)

Bug Fixes

  • hmr: prevent SSR from setting isSelfAccepting to false (#5377) (37e5617)
  • move package.json cache into ResolvedConfig (#5388) (650b56e)
  • scoped variable with array destructuring & nested arguments (#5730) (b86a2f3)
  • transformCjsImport: make dev and build get the same result (#5745) (9d3e4e6)

Features

  • dev: expose restart function on ViteDevServer (#5723) (1425a16)

2.7.0-beta.7 (2021-11-17)

Bug Fixes

2.7.0-beta.6 (2021-11-16)

Bug Fixes

2.7.0-beta.5 (2021-11-13)

Bug Fixes

  • correctly resolve virtual modules during import scan (#5659) (40d503c)
  • resolve: check nested directories for package.json (#5665) (022db52)
  • ssr: prefer CJS but still allow ESM entries (#5662) (72d8925)
  • tolerate undefined parent in hookNodeResolve callback (#5664) (d788682)

2.7.0-beta.4 (2021-11-12)

Bug Fixes

Features

2.7.0-beta.3 (2021-11-08)

2.7.0-beta.2 (2021-11-08)

Bug Fixes

  • commonjs: expose ignoreTryCatch config option (#5555) (d383c2a)
  • esbuild: respect esbuild config on build (#5538) (ff05fe9)
  • hmr: revert early break from handleHotUpdate loop (#5536) (4abade6)
  • replace server.origin in css plugin (fix #5408) (#5571) (bd8b66d)
  • server: use options argument in caching of transformRequest calls (#5391) (27b7f90)
  • Windows path error on script proxying (#5556) (f8dc1ee)

Features

2.7.0-beta.1 (2021-11-01)

Bug Fixes

2.7.0-beta.0 (2021-10-28)

Bug Fixes

Features

2.6.13 (2021-10-27)

Bug Fixes

2.6.12 (2021-10-26)

Bug Fixes

2.6.11 (2021-10-25)

Bug Fixes

Performance Improvements

2.6.10 (2021-10-18)

Bug Fixes

2.6.9 (2021-10-18)

2.6.8 (2021-10-18)

Bug Fixes

Features

2.6.7 (2021-10-11)

2.6.6 (2021-10-11)

Bug Fixes

  • avoid unnecessary pre-bundling warning (b586098)
  • server: skipped for ended response (#5230) (7255fd5)

Features

2.6.5 (2021-10-07)

Features

  • internal: expose printHttpServerUrls (f94a720)
  • server: expose server.printUrls() (96a9ee4)

2.6.4 (2021-10-07)

Bug Fixes

  • better error message for parse failures (#5192) (8fe8df3)
  • use Function instead of eval to dynamically import config files (#5213) (10694dd)

2.6.3 (2021-10-05)

Bug Fixes

2.6.2 (2021-09-30)

Bug Fixes

2.6.1 (2021-09-29)

Bug Fixes

2.6.0 (2021-09-29)

2.6.0-beta.4 (2021-09-28)

Bug Fixes

  • don't overwrite default options unless given new value (#5111) (4d72b40)
  • use global location for import.meta.url rewrite (fix #5087) (#5113) (0b54853)

2.6.0-beta.3 (2021-09-27)

Bug Fixes

Features

2.6.0-beta.2 (2021-09-23)

Bug Fixes

2.6.0-beta.1 (2021-09-23)

Bug Fixes

  • bump js parser ecmaVersion option to 'latest', fix #5013 (#5021) (3541ebc)
  • dedupe import analysis public name (#5032) (545b1f1)
  • exclude ?commonjs-external when building in JSON plugin (#4867) (fe25567)
  • exclude missing dependencies from optimization during SSR (#5017) (2204afa)
  • move peerDeps from #2042 to the right package.json (3161d75)
  • sourcemaps windows drive letter inconsistency, fix 4964 (#4985) (723cd63)
  • ssr: handle default arguments properly in ssrTransform (#5040) (6a60080)
  • use lax range for peer deps (35bd963)

Features

2.6.0-beta.0 (2021-09-20)

Bug Fixes

Features

Performance Improvements

  • report compressed size using gzip instead of brotli due to drastic (deb84c0)

2.5.7 (2021-09-13)

Bug Fixes

  • compute getPkgName only when used (#4729) (ce29273)
  • css: return sourcemap in vite:css transform (#4880) (015290a)
  • esbuildDepPlugin: externalize built-in module during SSR (#4904) (5cc4587)
  • the base is duplicated in importAnalysisBuild.ts (#4740) (7e929ae)

Features

2.5.6 (2021-09-08)

Bug Fixes

  • importAnalysis: properly inherit dependency version query for self imports (c7c39b1)
  • use debugger for package resolution warnings (#4873) (38de2c9)

2.5.5 (2021-09-08)

Bug Fixes

  • hmr: should break on first matched plugin that performs custom hmr handling (b3b8c61)

2.5.4 (2021-09-07)

Bug Fixes

  • check for Blob before creating worker URL, close #4462 (#4674) (311026f)
  • css: loadPreprocessor tolerate require.resolve.paths not exists (#4853) (c588b8f)
  • handle error in numberToPos and formatError (#4782) (c87763c)
  • overlay: handle missing customElements (#4856) (e5b472d)
  • sometimes THIS_IS_UNDEFINED warnings were still shown (#4844) (8d956f6)

2.5.3 (2021-09-01)

Bug Fixes

  • apply SSR externalization heuristic to devDependencies (#4699) (0f1d6be)
  • resolve: normalize optimized resolved path (#4813) (fa6475f)

2.5.2 (2021-08-31)

Bug Fixes

Features

2.5.1 (2021-08-24)

Bug Fixes

  • DEFINES is not defined is env (#4694) (ff50c22)
  • Matcher for chokidar WatchOptions#ignored (#4616) (89e7a41)
  • enable failing dependencies to be optimised by pre-processing them with esbuild (#4275) (ea98a1a)
  • css: minify css will transform rgba to #rrggbbaa (#4658) (632a50a)
  • CSS dependencies are tracked incorrectly when base is set (#4592) (633c03a)
  • css: dynamic import css abnormal after build (#3333) (b572f57)
  • scan: do not match 'export default' in comments (#4602) (8b85f5f)
  • vite: unexptected overwriting for default export fix(#4553) (#4596) (c7929ad)
  • surface exception when failing to resolve package entry (#4426) (f75e508)

Features

2.5.0 (2021-08-16)

2.5.0-beta.3 (2021-08-14)

Bug Fixes

  • add ?inline css query typings (#4570) (c8a17a2)
  • skip optimizer run on non-JS script tags (#4565) (270bd3a)
  • support dangling comma and throw on circular dependency in tsconfig (#4590) (f318416)

2.5.0-beta.2 (2021-08-09)

Bug Fixes

  • client: vite-error-overlay customElement is registered twice (#4475) (28a9612)
  • add missing assets to packages/vite/client.d.ts (#4516) (420d82d)
  • avoid crash when a file imported in SCSS does not exist (#4505) (a03e944)

Features

2.5.0-beta.1 (2021-08-04)

Bug Fixes

  • change the preview default mode from development to production (#4483) (77933ba)
  • close vite dev server before creating new one (#4374) (9e4572e)
  • register files added by addWatchFile() as current module's dependency (db4ba56), closes #3216

Features

2.5.0-beta.0 (2021-08-03)

Bug Fixes

  • mixed match result of importMetaUrl (#4482) (86f673a)
  • build: respect rollup output.assetFileNames, fix #2944 (#4352) (cbd0458)
  • deps: update all non-major dependencies (#4468) (cd54a22)
  • html: cover more cases in bodyPrependInjectRE (#4474) (40c51e1)
  • server: keep port when modifying the config file (#4460) (056b17e)
  • config port timing, fix #4094 (#4104) (6b98fdd)
  • overwrite configEnv.mode if the user explicitly set mode option (fix #4441) (#4437) (7d340a6)
  • update dependency @rollup/plugin-commonjs to v20, fix #2623 (#4469) (f9e5d63)
  • scan: improve import regex and allow multiline comments (#4088) (76dbef6)
  • @vite/client http request is 404 not found (#4187) (21ecdac)
  • import sass file even if not listed in package.json (#3627) (a5b2b4f)
  • the return value of resolve by adding a namespace when processing a '@' in filter (#3534) (d4e979f)
  • build: fix define plugin spread operations (#4397) (bd7c148)
  • preserve base in HMR for CSS referenced in link tags (#4407) (a06b26b)

Features

2.4.4 (2021-07-27)

Bug Fixes

  • deps: update all non-major dependencies (#4387) (2f900ba)
  • --https get ignored in preview (#4318) (a870584)
  • don't interact with res if refresh has happened (#4370) (c90b7d9)
  • fix pre-bundling executes multiple times (#3640) (41a00df)
  • handle imports from dot directories (#3739) (f4f0100)
  • ignore ENOENT in injectSourcesContent (#2904) (0693d03)
  • provide build load fallback for arbitrary request with queries (f097aa1)
  • css: cachedPostcssConfig reused for multiple builds (#3906) (3a97644)

Features

  • support ?inline css query to avoid css insertion (e1de8a8)

2.4.3 (2021-07-20)

Bug Fixes

Features

2.4.2 (2021-07-12)

Bug Fixes

Features

2.4.1 (2021-07-06)

Bug Fixes

2.4.0 (2021-07-05)

2.4.0-beta.3 (2021-07-02)

Bug Fixes

  • ssr: Transform named default exports without altering scope (#4053) (5211aaf)
  • add type: "module" hint to cache directory (#4063) (58a29b2)
  • allow preprocessor to be installed outside of the root directory (#3988) (a0a80f8)
  • Avoid importing in source that __vitePreload has declared (close #4016) (#4041) (bd34203)
  • ensure that esbuild uses the same working directory as Vite (#4001) (19abafe)
  • fix esbuild break when importRe matches multiline import (#4054) (eb2e41b)
  • skip redirect and error fallback on middleware mode (#4057) (d156a9f)
  • the current main branch code build the vite project error (#4059) (4adc970)
  • use .mjs extension for injected client modules (#4061) (cca92c4)
  • use path type import, fix #4028 (#4031) (e092e89)

2.4.0-beta.2 (2021-06-29)

Bug Fixes

2.4.0-beta.1 (2021-06-29)

Bug Fixes

  • hmr: entry mod's importers contains css mod invalidate hmr (#3929) (d97b33a)
  • types: correct import of types (#4003) (4954636)

Features

  • allow passing options to rollupjs dynamic import vars plugin (#3047) (5507b4c)

2.4.0-beta.0 (2021-06-27)

BREAKING CHANGES

  • server: server.fsServe renamed to server.fs (#3965)
  • server: server.fs.root deprecated in favor of server.fs.allow (#3968)

Security

We have improved the file serving boundaries detection with (#3784). While it's still experimental and disabled by default, you can opt-in it by

// vite.config.js
export default {
  server: {
    fs: {
      strict: true
    }
  }
}

It should smartly serve the files related to your project (directly imported, linked deps, etc.) while denying the rest. If you find any false-negative, please open an issue with reproduction to report.

Bug Fixes

Features

  • add client events to import.meta.hot.on (#3638) (de1ddd4)
  • fs-serve import graph awareness (#3784) (c45a02f)
  • generate inline sourcemaps for bundled vite.config.js files (#3949) (cff2fcd)
  • support for regex for ssr.noExternal (#3819) (330c94c)
  • support new URL(url, import.meta.url) usage (4cbb40d)

2.3.8 (2021-06-19)

Bug Fixes

  • css: filter out function name suffixes with url (#3752) (9aa255a)
  • deps: update all non-major dependencies (#3791) (74d409e)
  • hmr: always invalidate all affected modules (e048114)
  • hmr: avoid css propagation infinite loop (7362e6e)
  • hmr: avoid duplicated modules for css dependency (385ced9)
  • hmr/css: check CSS importers for hmr boundaries - fix Tailwind 2.2 compat (6eaec3a)
  • hmr/css: fix infinite recursion on hmr (#3865) (0d5726f)
  • ?import with trailing = added by some servers (#3805) (460d1cd)
  • don't replace process.env if process not global variable (#3703) (5aeadb7)
  • upgrade esbuild for esm compatibility (#3718) (dbb5eab), closes #3399 #3413

Features

  • allow 'hidden' sourcemap to remove //# sourceMappingURL from generated maps (#3684) (19e479b)

2.3.7 (2021-06-08)

Bug Fixes

  • Include src files in vite npm bundle (for sourcemaps) (#3656) (294d8b4)
  • show error message above the stack when HMR overlay is disabled (#3677) (6b4c355)
  • tolerant fs error in formatError (#3665) (5146cc5)
  • update sirv to decode url in preview (#3680) (0430127)

Features

  • css: support postcss dir-dependency message type (#3707) (665d438)

2.3.6 (2021-06-02)

Bug Fixes

2.3.5 (2021-06-01)

Bug Fixes

Features

2.3.4 (2021-05-25)

Bug Fixes

Features

  • support serving index.html in middleware mode (#2871) (b1598ce)

2.3.3 (2021-05-17)

Bug Fixes

2.3.2 (2021-05-12)

Bug Fixes

2.3.1 (2021-05-12)

Notable Changes

We introduced a security fix in v2.3.0 to restrict file access outside of the workspace root. We received reports of issues with symlinks and monorepo setups, so we are marking this feature as experimental and disabling it by default to avoid disruption in the ecosystem.

A new experimental option server.fsServe.strict was added defaulting to false. This disables the restrictions by default. The fsServe restrictions are going to be enabled by default in a future version, once the issues are been resolved and the logic becomes more robust. You can opt-in to this security change using (experimental)

// vite.config.js
export default {
  server: {
    fsServe: {
      strict: true
    }
  }
}

Bug Fixes

  • bump @rollup/plugin-commonjs to v19, fix #3312 (#3353) (c6ef6d0)
  • disable fsServe restrictions by default (#3377) (5433a65)
  • normalize url in ensureServingAccess (#3350) (deb465b)
  • use the closest package.json as root when workspace not found fo… (#3374) (42b35ac)

2.3.0 (2021-05-11)

BREAKING CHANGES

  • Browser default targets changed (PR #2976)
    • Default browser support range has changed. The minimum requirement is now native dynamic import support. Most notably, this means support for legacy Microsoft Edge (16-18) has been dropped.
    • vite/dynamic-import-polyfill removed and no longer required in custom entries

Why are there breaking changes in a minor?

  • Limited impact: The affected target browsers are ones that natively support ES6 modules (92.83% of global usage) but do not support native dynamic imports (92.34% of global usage). So this is a small range affecting only 0.49% of global usage.

    This number should continue to decrease in the future as most modern browsers are evergreen. You are also not affected if you are already targeting legacy browsers using @vitejs/plugin-legacy.

  • Easy migration: if you do intend to support browsers that fall into this category, you can use dynamic-import-polyfill.

    To make the polyfill work, you will also need to use a plugin with renderDynamicImport to change the import calls to __import__. You can follow the installation guide in this example.

  • Required for bug fixes: This change is required for upgrading esbuild from v0.9 to v0.11, which includes a lot of bug fixes and improvements. And it also allows us to remove the complexity of the dynamic import polyfill.

Security Fixes

  • Dev server only listens to localhost by default now (PR #2977)
    • Pass --host 0.0.0.0 to change back to the previous behavior.
  • Dev server only serves files under workspace root by defualt (PR #2850, #3321)
    • Accessing files outside of workspace root will result in a 403 response.
    • Vite will try to search up for workspace root defined in package.json or pnpm-workspace.yaml
    • To set the workspace root explicitly, see configurations

Bug Fixes

Features

  • add optimizeDeps.esbuildOptions (#2991) (77a882a)
  • set publicDir to false to disable copied static assets to build dist dir (#3152) (f4ab90a)
  • webworker ssr target (#3151) (1c59ef1)

2.2.4 (2021-05-03)

Bug Fixes

Features

  • Allow overwrite TerserOptions.safari10 from UserConfig (#3113) (7cd8d78)

2.2.3 (2021-04-25)

Bug Fixes

2.2.2 (2021-04-24)

Bug Fixes

Features

2.2.1 (2021-04-19)

Bug Fixes

  • optimizer: depScan resolve with flatIdDeps (#3053) (cb441ef)

2.2.0 (2021-04-19)

Bug Fixes

Features

2.1.5 (2021-03-31)

Bug Fixes

  • do not inject ?import query to external urls (be3a4f5)
  • replace __dirname and __filename in config file, fix #2728 (#2780) (eb57ac6)

2.1.4 (2021-03-30)

Bug Fixes

Features

  • dev: support keepNames option for optimizeDependencies config (#2742) (130bf5a)

2.1.3 (2021-03-25)

Bug Fixes

Features

2.1.2 (2021-03-17)

Bug Fixes

  • update esbuild target to allow destructuring (#2566) (da49782)
  • manifest: do not fail when using rollupOtions.external (#2532) (e44cc11)

2.1.1 (2021-03-16)

Bug Fixes

  • decode path before reading sourcemap source content (73b80d5), closes #2524
  • scan: handle await replacement edge case (cbfc3e9), closes #2528
  • enable latest syntax when parsing for ssr (407ce3b), closes #2526

2.1.0 (2021-03-15)

Bug Fixes

  • json: support importing json with ?url and ?raw queries (fd0a0d9), closes #2455
  • ssr: fix mistakenly overwriting destructure variables as import bindings (#2417) (24c866f), closes #2409
  • correctly handle explicit ts config file (#2515) (e8f3c78)
  • hmr: never invalidate an accepting importer (#2457) (63bd250)
  • ssr: handle empty sourcemaps (fix #2391) (#2441) (103dec9)
  • fix early logger definiton in resolveConfig (#2425) (96ea9f4)
  • Improve how @fs urls are printed (#2362) (5d4e82d)
  • Improve injectQuery path handling (#2435) (a5412f8), closes #2422
  • keep process running when fail to load config in restarting server (#2510) (b18af15), closes #2496
  • make import resolution failures easier to track down (#2450) (f6ac860)
  • respect cors and proxy options in preview command (f7d85ae), closes #2279
  • url linked to wmr rollup-plugin-container.js found 404 (#2368) (209232c)
  • build: respect rollupOtions.external at generate manifest(#2353) (b05a567)

Features

  • allow custom websocket server (#2338) (9243cc9)
  • bundle vite config file with esbuild instead of rollup (#2517) (e034ee2)
  • dev: support keepNames for dependencies (#2376) (b5cd8c8)

2.0.5 (2021-03-02)

Bug Fixes

2.0.4 (2021-02-26)

Bug Fixes

  • build: css tags injection priority (#2272) (55ad23e)
  • css: ignore css commonjs-proxy modules (#2160) (de33d32)
  • optimizer: detect re-exports in dep entries (a3abf99), closes #2219
  • sourcemap: avoid cjs import interop line offset messing up sourcemap (4ce972d), closes #2280
  • sourcemap: inject sourcesContent for .map requests (#2283) (8d50b18)
  • ssr: allow ssr module export overwrites (#2228) (6fae0b7)
  • add source and sourcesContent to transformed SSR modules (#2285) (72be67b), closes #2284
  • optimizer: fix deps aliased to cdns that are imported by optimized deps (06d3244), closes #2268
  • ssr: handle imported binding being used as super class (167a9c3), closes #2221
  • ssr: handle ssrLoadModule failures in post pending (#2253) (ea323cc), closes #2252
  • ssr: ssr transform method definition (#2223) (8e0c0fa)
  • decode url before serving static files (#2201) (1342108), closes #2195
  • determine anonymous function wrapper offset at runtime (#2266) (a2ee885), closes #2265

2.0.3 (2021-02-24)

Bug Fixes

  • resolve: compat for babel 7.13 helper resolution (39820b9)
  • ssr: fix ssr external check for mjs entries (5095e04), closes #2161
  • do not prepend base to double slash urls during dev (#2143) (7a1b5c6)
  • handle escape sequences in import specifiers (#2162) (bbda31e), closes #2083
  • should transform the img tag's srcset arrtibute and css' image-set property (#2188) (0f17a74), closes #2177
  • treat the watcher path as literal name (#2211) (58bed16), closes #2179
  • use proper esbuild loader for .cjs and .mjs files (#2215) (a0d922e)
  • optimizer: let esbuild resolve transitive deps (0138ef3), closes #2199
  • scan: avoid replacing await in import specifiers (94e5b9a), closes #2210

2.0.2 (2021-02-22)

Bug Fixes

  • build: do not handle asset url when its url is "#" (#2097) (0092a35), closes #2096
  • cli: fix short flags being ignored (#2131) (cbb3eff)
  • optimizer: do not optimize deps w/ jsx entrypoints (1857652), closes #2107
  • optimizer: externalize jsx/tsx files in dependencies (37a103f)
  • optimizer: fix .styl externalization (87cfd9e), closes #2168
  • resolve: fix browser mapping fallback (de58967), closes #2115
  • scan: set namespace when resolving to html (#2174) (3be4fac), closes #2163
  • ssr: avoid duplicate ssr module instantiation on shared imports (a763ffd), closes #2060
  • ssr: fix ssr export * from (8ed67cf), closes #2158
  • typo (#2149) (2b19e3c)
  • ssr: reject ssrLoadModule promises if evaluation fails (#2079) (e303c4e), closes #2078
  • stricter html fallback check in transformRequest (d0eac2f), closes #2051

2.0.1 (2021-02-17)

Bug Fixes

  • allow custom process.env.VAR defines (#2055) (7def49a)
  • do not error on failed load for SPA html requests (44a30d5), closes #2051
  • more inclusive config syntax error hanlding for Node 12.x (27785f7), closes #2050

2.0.0 (2021-02-16)

Bug Fixes

  • css/assets: respect alias in css url() paths (ad50060), closes #2043
  • resolve: handle hash fragment in fs resolve (34064c8)
  • scan: fix top level await handling in script setup (24ed098), closes #2044
  • scan: ignore virtual entries during scan (6dc2d56), closes #2047
  • always transform applicable requests (#2041) (4fd61ab)

2.0.0-beta.70 (2021-02-15)

Bug Fixes

  • respect host option when listening (f05ae32), closes #2032
  • css: resolve pre-processors from project root (ddfcbce), closes #2030
  • reject preload promise if link fails to load (#2027) (f74d65d), closes #2009
  • ssr: ignore base when normalizing urls for ssr (26d409b), closes #1995

Code Refactoring

  • make define option perform direct replacement instead (059070e)

Features

  • css: allow async additionalData function for css pre-processors (20f609d), closes #2002
  • allow getJSON option on css.modules (#2025) (e324e36)

BREAKING CHANGES

  • define option no longer calls JSON.stringify on string values. This means string define values will be now treated as raw expressions. To define a string constant, explicit quotes are now required.

2.0.0-beta.69 (2021-02-11)

Bug Fixes

  • fix out of root static file serving on windows (4d34a73), closes #1982
  • Remove negative count in stdout with 0 rows (#1983) (09b13ed), closes #1981
  • ssr: handle virtual modules during ssr (108be94), closes #1980
  • prevent crash on malformed URI (#1977) (f1b0bc9)
  • user define on import.meta.env should apply during dev (603d57e)

Features

  • pass config env to plugin config hook (19f3503)

2.0.0-beta.68 (2021-02-11)

Bug Fixes

  • css/assets: properly replace multiple css asset urls on the same line (1d805a6), closes #1975
  • scan: handle lang=jsx in sfcs (2f9549c), closes #1972
  • fix path normalization for windows paths w/ non ascii chars (03b323d), closes #1384

Features

  • support --open for vite preview command (#1968) (446b815)
  • resolve: expose full resolve options via config (0318c64), closes #1951

Performance Improvements

  • ignore node_modules when globbing import.meta.glob (8b3d0ea), closes #1974

2.0.0-beta.67 (2021-02-09)

Bug Fixes

  • html: avoid duplicate preload link injection (6e71596), closes #1957
  • ssr: fix ssr node require for virtual modules (fa2d7d6)
  • do not open browser when restarting server (#1952) (9af1517)

2.0.0-beta.66 (2021-02-08)

Bug Fixes

  • import-analysis: fix literal dynamic id false positive (6a6508e), closes #1902
  • resolve: avoid race condition in resolve skip check (85f1e7b), closes #1937
  • resolve: pass down resolve skip via context (9066f27), closes #1937
  • scan: only scan supported entry file types (a93e61d)
  • use dedicated endpoint for hmr reconnect ping (b433607), closes #1904
  • ssr: ssr external should take scannd imports into account (92934d4), closes #1916
  • brotli skipped is printed when build.brotliSize is false (#1912) (db3c324)

2.0.0-beta.65 (2021-02-05)

Bug Fixes

  • build: ignore html asset urls that do not exist on disk (02653f0), closes #1885
  • better dependency non-js type file handling (1fdc710)
  • dev: check wasClean in onclose event (#1872) (5d3107a)
  • resolve: prioritize file over dir with same name for resolve (c741872), closes #1871
  • ssr: respect user defines for ssr (3fad3ba)
  • do not include vite in ssr externals (578c591), closes #1865

Code Refactoring

  • css: use default CSS modules localsConvention settings (fee7393)

Features

Performance Improvements

BREAKING CHANGES

  • css: CSS modules now defaults to export class names as-is. To get camelCase exports like before, explictly set css.modules.localsConvention via config.

2.0.0-beta.64 (2021-02-03)

Bug Fixes

  • ssr: do not resolve to optimized deps during ssr (d021506), closes #1860
  • ssr: fix externalized cjs deps that exports compiled esmodule (8ec2d6f)

2.0.0-beta.63 (2021-02-03)

Bug Fixes

  • css: hoist external @import in concatenated css (000ee62), closes #1845
  • css: respect sass partial import convention (cb7b6be)
  • vite: close server and exit if stdin ends (#1857) (b065ede)
  • consistently use mode for NODE_ENV in deps (cd13ef0)
  • do not shim process with actual object (8ad7ecd)
  • make ssr external behavior consistent between dev/build (e089eff)
  • only close if http server has listened (94a8042), closes #1855
  • scan: handle import glob in jsx/tsx files (24695fe)
  • ssr: improve ssr external heuristics (928fc33), closes #1854
  • respect config.build.brotliSize in reporter (1d5437d)

Features

  • ssr: graduate ssr method types (0fe2634)

2.0.0-beta.62 (2021-02-02)

Bug Fixes

  • properly cascade asset hash change (f8e4eeb)
  • optimizer: fix cjs interop check on entries with identical ending (338d17a), closes #1847
  • scan: handle tsx lang in SFCs during dep scan (#1837) (be9bc3f)

Features

  • dev: inject env for webworker (#1846) (5735692), closes #1838
  • better build output + options for brotli / chunk size warning (da1b06f)

2.0.0-beta.61 (2021-02-01)

Bug Fixes

  • less: fix less @import url rebasing (41783fa), closes #1834
  • manifest: include assets referenced via CSS in manifest entries (34894a2), closes #1827
  • yarn pnp resolveDir (9c6edef)
  • optimizer: fix cjs export interop for webpacked output (4b6ebc3), closes #1830
  • ssr: do not inject hmr timestamp when transforming for ssr (#1825) (8ace645)

2.0.0-beta.60 (2021-01-31)

Bug Fixes

  • hmr: do not update on file unlink when there are no affected modules (#1818) (59fe913)
  • optimizer: entry resolving for yarn pnp (febff7b), closes #1813
  • optimizer: fix cjs interop for packages that cannot be (3b85296), closes #1821
  • scan: skip non-absolute resolved paths during scan (f635971)

Features

  • support ?url special query (0006e89)

2.0.0-beta.59 (2021-01-30)

Bug Fixes

  • optimizer: exclude should apply to deep imports (3c22f84)
  • optimizer: separate dep entry proxy modules from actual modules (8e1d3d8)

2.0.0-beta.58 (2021-01-29)

Bug Fixes

  • optimizer: handle rollup plugin virtual ids (a748896), closes #1804
  • do not generate import specifier if not needed (e438802)

Features

  • add ViteDevServer.transformIndexHtml method for ssr (dbe1f4a), closes #1745
  • support configuring publicDir via config (470ceb8), closes #1799

2.0.0-beta.57 (2021-01-29)

Bug Fixes

  • optimizer: fix entry cross imports (a9ca3da), closes #1801
  • optimizer: respect ids that resolve to external urls during scan (328b6b9), closes #1798
  • still account for plugins in optimizer hash (82dce90)
  • optimizer: check qualified deps length after accounting for include (6a03813)
  • optimizer: exclude ?worker and ?raw from runtime dep discovery (d216da0)
  • optimizer: properly externalize unknown types (c3b81a8), closes #1793

2.0.0-beta.56 (2021-01-29)

Bug Fixes

  • optimizer: handle alias to optimized entries (81eb7a0), closes #1780

Performance Improvements

  • use esbuild service mode during pre-bundling (b24b07c)

2.0.0-beta.55 (2021-01-28)

Bug Fixes

  • optimizer: use js loader for resolved mjs files in esbuild (0f2c2ce)

2.0.0-beta.54 (2021-01-28)

Bug Fixes

  • optimizer: map entries to their file paths when passed as importer (32ba8fb)

2.0.0-beta.53 (2021-01-28)

Bug Fixes

  • css: pure css chunk removal + manifest entry with multiple css files (cadf38c), closes #1776
  • optimizer: add separate hash for invalidating optimized deps (216ae8e)
  • optimizer: externalize json (c3e52f2)
  • optimizer: invalidate all modules on deps rebundle (02053a2)
  • optimizer: use vite resolver for yarn 2 fallback (475aae4), closes #1778
  • fix pure css chunk removal (d69d49d)
  • optimizer: use all inputs for optimized entry matching (9ecf52b), closes #1769
  • dependency scan with esbuild when using non-HTML entrypoints (#1772) (ca862a2), closes #1763
  • hold missing dep requests while re-bundling (8e28803)
  • more stable request hold (be0e698)

Reverts

  • Revert "chore: remove unused logic" (6b154f0)

BREAKING CHANGES

  • css: the "css" property of build manifest entries is now an array because it is possible for an entry to link to multiple generated css files.

2.0.0-beta.52 (2021-01-28)

Bug Fixes

  • optimizer: fix ?raw import and import with queries in pre-bundling (2f1efa3), closes #1759
  • always normalize fs prefix slashes (99e4edd)
  • optimizer: fix optimizer updates on new dep discovery (b2110af), closes #1755

2.0.0-beta.51 (2021-01-27)

Bug Fixes

  • avoid removing double slash in fileToUrl (f6db155)
  • build: ensure lib mode file name is correctly inferred for scoped packages (#1754) (c2e8806)
  • hmr: fix hmr for @fs urls (b5987c1), closes #1749
  • optimizer: attempt resolve node builtin first before externalizing (74b55b8), closes #1746
  • allow ssr css preloads in preload-helper (#1734) (1dfda16)
  • handle vite client path with dollar signs (#1732) (20bacf7), closes #1423
  • scan on windows (5f7698b)
  • optimizer: entry matching for .mjs entries (ebe71c4), closes #1739
  • css @import alias for windows (71fcfdf)
  • don't override resolver options (#1740) (73196e5)
  • resolve css @import relative imports without leading dot (78eb32c), closes #1737
  • optimizer: do not perform tree-shaking for pre-bundling (6b619c4)

Code Refactoring

  • adjust optimizeDeps options (fd5e7c0)

Features

  • auto re-run dep optimization on discovery of new imports (470b4e4)
  • dep optimizer entry option (64ba807)
  • import resolving + url rebasing for less (f266bb7)
  • new manifest format (51bc1ec)
  • proper css resolving + sass import url rebase (477f174)
  • use esbuild to scan imports (d0f8b12)
  • css: support alias in css @imports (82d87d9), closes #650

BREAKING CHANGES

  • optimizeDeps options have been adjusted.
    • Dependencies are now automatically scanned from source code. There is no longer the need to specify deep imports.
    • optimizeDeps.include and optimizeDeps.exclude now expect type string[].
    • optimizeDpes.link and optimizeDeps.auto are removed.
  • the build manifest format has changed. See https://vitejs.dev/guide/backend-integration.html for more details.

2.0.0-beta.50 (2021-01-26)

Bug Fixes

  • json plugin error report line regex (#1719) (35e1f52)
  • optimizer: externalize cross-package imported css (0599908), closes #1722
  • optimizer: fix entry analysis fs read on case-sensitive systems (1a9b321), closes #1720
  • optimizer: fix entry matching edge case (c5fe45f), closes #1661
  • optimizer: handle special case where esm entry gets converted to cjs by esbuild (32413ce), closes #1724
  • optimizer: pnp compat to match relative paths (#1714) (8fb74f5)
  • sourcemap: empty source map chain on nullified sourcemap (52c9416), closes #1726
  • properly handle base + path in hmr config (1e67d66)

Features

  • allow speicfying ssr entry directly via build.ssr option (45d8bf4)

2.0.0-beta.49 (2021-01-25)

Bug Fixes

  • config: fix native esm config loading on windows (33d3cca)
  • optimizer: entry matching on windows (e6120d5)
  • optimizer: fix output to entry matching logic (6c96883), closes #1704
  • ssr: generate same asset url links for ssr build (68960f7), closes #1711
  • watcher: ensure only add normalized file paths (a19c456)
  • watcher: watch fs specific root paths (64d2c17)
  • do not move css modules to vendor chunk (3d55e83), closes #1703
  • fix hmr.path option normalization (cbeb9ba), closes #1705

2.0.0-beta.48 (2021-01-25)

Bug Fixes

  • externalize known css types during dep-prebundling (02a0324), closes #1695
  • fallback to static middleware on unfound source maps (2096309)
  • preload marker incorrect replacement (7f83deb)
  • remove preload markers in all cases (6cd2d35), closes #1694
  • resolve library entry (3240db1)

Features

2.0.0-beta.47 (2021-01-24)

Bug Fixes

  • do not apply json plugin to commonjs proxy (a92f430), closes #1679
  • esbuild optimizer yarn 2 pnp compat (028c3bb), closes #1688
  • fix incorrect preload placeholder regex (5ca43ef), closes #1686
  • fix server.watch option ignore overwriting defaults (#1680) (33cffa3)

Performance Improvements

  • build: improve performance of default vendor chunk splitting (#1690) (0bed9c4)

2.0.0-beta.46 (2021-01-24)

Bug Fixes

  • css: fix extract concurrency issue when disabling cssCodeSplit (4ac7e7e)

2.0.0-beta.45 (2021-01-24)

Bug Fixes

  • hmr: fix nested hmr accept calls with base (2950c3c)
  • hmr: preserve host when updating link CSS (60f9782), closes #1665
  • html: ensure quote in rebased asset urls in html (7306610), closes #1668
  • import-anaysis: markPos out-of-range for overwrite (#1671) (226e984)
  • optimizer: repsect alias in pre-bundling (2824d06), closes #1674
  • resolve: handle paths starting with slash in entry fields (13da32e), closes #1676
  • import analysis dynamic import check (d4909b9)
  • revert trailing slash handling + improve dev base usage (01e9ac0), closes #1664
  • support empty, relative and external base values (00bc446), closes #1669

Features

  • default vendor chunk splitting (f6b58a0)
  • disable prompts and clearScreen on CI (63dd1a2), closes #1673
  • source map for optimized deps (972b13e)
  • support stringifying json (98c321b), closes #1672
  • vite preview command for previewing build output (a198990), closes #1627

2.0.0-beta.44 (2021-01-23)

Bug Fixes

  • esbuild dep resolving on windows (62e4d72)

2.0.0-beta.43 (2021-01-23)

Bug Fixes

  • optimizer: force vite resolver for esbuild pre-bundle (4c4d629)

2.0.0-beta.42 (2021-01-23)

Bug Fixes

  • optimizer: ensure esbuild use vite-resolved entries (bdb9b3c)

2.0.0-beta.41 (2021-01-23)

Bug Fixes

2.0.0-beta.40 (2021-01-23)

Bug Fixes

  • optimizer: compiled esmdoule interop (6826624), closes #1659

2.0.0-beta.39 (2021-01-23)

Bug Fixes

  • optimizer: fix es interop heuristics for entry with only export * from (ef1a7e3)
  • ssr: do not inject ?import query for ssr transforms (7d26119), closes #1655
  • hmr port fallback in middlewareMode (36a9456)
  • ssr: avoid resolving externals to mjs (3955fe3)
  • file dir resolve should prioritize package.json (ce2d49a)
  • ssr: remove import query in ssrLoadModule (80473c1)

2.0.0-beta.38 (2021-01-23)

Bug Fixes

  • dev: remove comment for sourcemap reference at debug (#1658) (16248c0)
  • optimizer: improve exports analysis (406cbea)
  • ssr: fix ssr transform edge cases (f22ddbd), closes #1646
  • exclude spa-fallback middleware in middlewareMode (#1645) (843c879)

Code Refactoring

  • remove optimizeDeps.plugins (38524f6)

Features

  • esbuild based dep pre-bundling (6e7f652)
  • support base option during dev, deprecate build.base (#1556) (809d4bd)

BREAKING CHANGES

  • optimizeDeps.plugins has been removed. The dep optimizer is now using esbuild, and all non-js files are automatically externalized to be processed by Vite's transform pipeline when imported.

2.0.0-beta.37 (2021-01-22)

Bug Fixes

  • css: fix url rewriting in @imported css (52ae44f), closes #1629
  • manifest: avoid chunks with same name overwriting one another (cf81aa3), closes #1632
  • ssr: do not inject inlined css in ssr build (5d77665), closes #1643
  • always reload when html is edited in middleware mode (85c89be)
  • handle esm config syntax error in Node 12 (20cf718), closes #1635
  • normalize paths for cjs optimized deps on windows (#1631) (b462e33)
  • still resolve jsnext fields (4e0cd73)

Features

2.0.0-beta.36 (2021-01-21)

Bug Fixes

  • always reload when html is edited in middleware mode (85c89be)
  • still resolve jsnext fields (6e06108)

Features

2.0.0-beta.35 (2021-01-20)

Bug Fixes

  • allow direct inspection of static file via browser (a3c334f), closes #1612
  • also resolve for module condition (3a3029e), closes #1583
  • do not apply jsxInject on ts files (a72a59c)
  • inline async css for legacy builds (940d483)
  • manually test global regex codeframeRE index (#1608) (20d6c0f)
  • properly format css pre-processor errors from @imported files (ec18bde), closes #1600 #1601
  • asset: use stricter asset url marker and regex (e6c8478), closes #1602
  • plugin-dynamic-import: include assetDir in dynamic import polyfill module path (#1610) (47ff0f4)
  • resolve: get pkg from importer for relative id (#1599) (c821f09)

Features

  • manifest: include dynamic entries and dynamic imports (#1609) (9ed4908)
  • detect and warn against imports to transitively optimized deps (3841e70), closes #1543

2.0.0-beta.34 (2021-01-20)

Bug Fixes

  • default changeOrigin to true in proxy option shorthand (b008bd5), closes #1577
  • emit css only once when there are multiple outputs (6bce108), closes #1590
  • optimizer: handle commonjs require css (#1568) (3d09b50), closes #1566
  • handle legacy chunks in manifest (123b6f6), closes #1551
  • use safe dynamic import rewrite (5cb02ce), closes #1563
  • hmr: fix hmr invalidation on circular deps (ca8442c), closes #1477
  • resolve: node resolve from virtual modules (c6d5ed8)

2.0.0-beta.33 (2021-01-19)

Bug Fixes

  • fix ssr module invalidation infinite loop (30885d1), closes #1591

2.0.0-beta.32 (2021-01-19)

Bug Fixes

  • avoid preloading owner chunk (61969d7)
  • ssr transform check valid inMap (bf4b3e9)
  • support resolving .json ext to be consistent with Node (a1d1dde)

Code Refactoring

  • rename ViteDevServer.app -> ViteDevServer.middlewares (394390a)

Features

  • import.meta.env.SSR (fe7396d)
  • ssr manifest for preload inference (107e79e)
  • ssr: isolated mode (e954ed2)
  • ssr sourcemap + stacktrace fix (6cb04fa)

BREAKING CHANGES

  • ViteDevServer.app is now ViteDevServer.middlewares. In addition, Vite no longer serves index.html in middleware mode. The server using Vite as middleware is responsible for serving HTML with /@vite/client injected.

2.0.0-beta.31 (2021-01-18)

Bug Fixes

  • workaround for ts config + native esm w/ imports (4a7d2eb), closes #1560
  • resolve: also respect browser mapping of dependencies (12b706d), closes #1547

2.0.0-beta.30 (2021-01-15)

Bug Fixes

  • config: delete cache correctly when restarting server (#1541) (bd3b1bf)
  • config: load native esm ts config string with base64 encoding (55b05db), closes #1548

2.0.0-beta.29 (2021-01-14)

Bug Fixes

  • optimizer: fix empty exclude filter (4579c38)
  • fix graceful shutdown on sigint (fe7238c)
  • warn failed source map load instead of erroring (7a1261b)

2.0.0-beta.28 (2021-01-14)

Bug Fixes

  • alias should work for optimized deps (54dab71)
  • serve out of root static file on windows (#1537) (506bf2d)
  • dev: correct responce for html qurey (#1526) (49d294d), closes #1524
  • optimizer: should respect rollup external during pre-bundling (db97317), closes #1528

Features

  • add clearScreen option (c5c3298)
  • close server on sigint/sigterm (4338d7d), closes #1525
  • support specifying URL path via server.open option (#1514) (25e9c44)
  • support using vite as a middleware (960b420)

2.0.0-beta.27 (2021-01-13)

Bug Fixes

  • transform import.meta.url in config files (98e57de), closes #1511

Features

  • vite: support RegExp strings as server.proxy keys (#1510) (f39a2aa)
  • warn unintended dependency during pre-bundling (ae6cc27)

2.0.0-beta.26 (2021-01-13)

Bug Fixes

  • properly externalize resolved external urls (6cda88d)

2.0.0-beta.25 (2021-01-12)

Bug Fixes

  • Revert "feat: allow browser new window view source (#1496)" (64fde38), closes #1507

Features

  • support aliasing to external url (abf7844)

2.0.0-beta.24 (2021-01-12)

Bug Fixes

  • hmr: watch file changes even when HMR is disabled (#1504) (cc5fa6e)
  • always replace preload marker with value (2d6f524)
  • more consistent outDir formatting (50bff79), closes #1497
  • show target build mode in logs (#1498) (ae2e14b)
  • support import.meta.url in ts esm config file (cf5f3ab), closes #1499

Features

  • allow browser new window view source (#1496) (1629c54)
  • require explicit option to empty outDir when it is out of root (730d2f0), closes #1501

2.0.0-beta.23 (2021-01-12)

Bug Fixes

2.0.0-beta.22 (2021-01-11)

Bug Fixes

  • handle http proxy error (4ca20f2), closes #1485
  • optimizer hash should take inline mode into account (0aed0e8), closes #1490
  • support resolved Ids that start with null bytes (7074414), closes #1471
  • config: support native esm config on windows + support TS config in native esm projects (803f6da), closes #1487

Features

  • resolve: support subpath patterns + production/development conditinals in exports field (62cbd53)
  • server: add strict-port option (#1453) (0501084)

2.0.0-beta.21 (2021-01-11)

Bug Fixes

  • properly remove dynamic import args for full dynamic imports (d9c3fdb)

2.0.0-beta.20 (2021-01-11)

Bug Fixes

  • optimizer: exclude should not be resolve (#1469) (f8c34ee)
  • resolve: heuristics for browser vs. module field (1865e6e), closes #1467

Features

  • allow passing options to rollup commonjs plugin via build.commonjsOptions (6ed8e28), closes #1460
  • async chunk loading optimizations (e6f7fba)

2.0.0-beta.19 (2021-01-10)

Bug Fixes

2.0.0-beta.18 (2021-01-10)

Bug Fixes

  • fix dynamic import with parent relative paths (bbfe06c), closes #1461
  • optimizer: properly externalize css/asset imports in optimized deps (5d180db), closes #1443

Features

  • optimizer: support specifying plugins for the optimizer (1ea0168)

2.0.0-beta.17 (2021-01-10)

Code Refactoring

  • support glob import under import.meta.glob (23d0f2b)

BREAKING CHANGES

  • Glob import syntax has changed. The feature is now exposed under import.meta.glob (lazy, exposes dynamic import functions) and import.meta.globEager (eager, exposes already imported modules).

2.0.0-beta.16 (2021-01-09)

Bug Fixes

Features

  • allow tag injection after body open (body-prepend) (#1435) (432487e)

2.0.0-beta.15 (2021-01-09)

Bug Fixes

  • hmr: ensure all modules are fetched as import (98bc767)

2.0.0-beta.14 (2021-01-09)

Features

  • support ../ paths in glob import (7f399e1)

2.0.0-beta.13 (2021-01-09)

Bug Fixes

  • always rebase path against root (d704b7c), closes #1413
  • handle potential imports that has no correspodning chunks (d47e10c)
  • raw fetch requests should not be transformed (0356c3c), closes #1433
  • skip cjs rewrite for export * declarations (cca015b), closes #1439
  • cli: fix help for --root (#1429) (7a55c5b)
  • dev: decode url before sirv resolve (#1432) (7cc3cf1), closes #1426

Features

  • allow user define to overwrite default process.env. defines (351ad4e)
  • build support for data uri import (4fd0b86)
  • support import "glob:./*" (8d8e2cc)

2.0.0-beta.12 (2021-01-07)

Bug Fixes

  • plugin-legacy: avoid esbuild transform on legacy chunks (7734105)

2.0.0-beta.11 (2021-01-07)

Bug Fixes

  • preserve html comments during dev (b295400), closes #1420
  • resolve: respect exports env key order (b58c860), closes #1418
  • avoid excessive quote in css public urls (1437129), closes #1399
  • do not rewrite dynamic import if format is not native es (eb35bd5)
  • esbuild transform should filter id with and wihtout query (4cda5be)
  • fix cache invalidation for non-optimized deps with cross imports (11c407a), closes #1401
  • html transform should not render boolean attr with false value (a59ffef)
  • remove vue from optimize ignore list (9eab790), closes #1408
  • support serving extension-less files in /public (a7bca9c), closes #1364
  • build: inline quotes css url to base64 (#1412) (9b5b352), closes #1409 #1413

Code Refactoring

  • pass configFile via inline config instead of extra arg in most (24b3b5a)

Features

  • support specifying mode in user config (396bbf8), closes #1380
  • plugin-legacy: @vitejs/plugin-legacy (8c34870)
  • proxy: add rewrite support for ws (#1407) (fa3bc34)
  • also expose correspodning chunk in build html transform (b2f4836)
  • expose loadConfigFromFile API (#1403) (9582171)

BREAKING CHANGES

  • the following JavaScript APIs now expect configFile as a property of the config object passed in instead of an argument:

    • createServer
    • build
    • resolveConfig

2.0.0-beta.10 (2021-01-06)

Bug Fixes

  • alias: normalize alias behavior when there is ending slash (c4739a3), closes #1363
  • build: Pass allowNodeBuiltins to rollup instead of empty array (Fixes #1392) (#1393) (f209ad9)
  • avoid replacing process.env member expression (c8f4bb9), closes #930

2.0.0-beta.9 (2021-01-06)

Bug Fixes

  • properly handle browser: false resolving (da09320), closes #1386
  • properly handle ts worker source (eea1224), closes #1385

Features

  • env: also expose VITE_ variables from actual env (956cd2c)

2.0.0-beta.8 (2021-01-05)

Bug Fixes

  • resolve: handle exports field w/ mapped directory (724aa8a)

Features

  • build: default build target to 'modules' with dynamic import polyfill (756e90f)
  • allow boolean attr values in html transform tag descriptors (#1381) (0fad96e)

2.0.0-beta.7 (2021-01-05)

Code Refactoring

  • update client type usage (245303c)

BREAKING CHANGES

  • client types are now exposed under vite/client.d.ts. It can now be included via the following tsconfig.json:

    {
      "compilerOptions": {
        "types": ["vite/client"]
      }
    }

2.0.0-beta.6 (2021-01-05)

Bug Fixes

  • css: ensure options for .styl (b3237ff), closes #1351
  • error-handling: avoid serilaizing unnecessary error properties when seinding to client (61aec65), closes #1373
  • optimizer: optimizer should not be affected by config rollup options (ba08310), closes #1372
  • support aliases in html references (68eac64), closes #1363
  • optimizer: resolve linked dep from relative root (#1375) (034bbcd)

Code Refactoring

  • remove the need for specifying transformInclude (99522d0)

Features

  • exclude vue from optimization (1046fe0)
  • improve import analysis fail warning (2b39fce), closes #1368

BREAKING CHANGES

  • transformInclude option has been removed and is no longer necessary. This allows full dynamic imports to custom file types to automatically qualify for the transform pipeline.

    • All requests that accept */* AND is not declared an asset type will now qualify for the transform pipeline.

    • To exclude an asset type from being transformed when requested directly, declare it as asset via config.assetsInclude.

2.0.0-beta.5 (2021-01-05)

Bug Fixes

  • only append dep version query for known types (42cd8b2)
  • css: fix css comment removal (7b9dee0), closes #1359
  • css: inline css in all non-entry split chunks (e90ff76), closes #1356
  • do not bundle resolve for yarn 2 compat (3524e96), closes #1353
  • do not error on unresolved commonjs externals (60a4708), closes #1339
  • only allow built-ins as externals if building for ssr (804c9a3)
  • run mutiple output builds sequantially (ab80522)

Features

  • types: separate client type shims from main types (0cddbbc)
  • default clean-css level to 1 + expose options (ef100d0), closes #936
  • support plugin.apply (d914b54)

2.0.0-beta.4 (2021-01-04)

Bug Fixes

  • stop service in build esbuild plugin as well (1a90b4e)
  • build: rollup import resolving message (#1336) [skip ci] (87d55f4)
  • resolve: always prioritize browser field (409988f)
  • @fs paths resolving for win32 (#1317) (0a94c88)
  • do not error on css deep imports (25adf1e)
  • ensure consistent module entry urls by removing import query (2b82e84), closes #1321
  • load source map from sourceMappingURL comment (#1327) (1f89b0e)
  • sourcemap path mangled by browser (#1326) (1da12ba), closes #1323
  • dev: display localetime correctly (#1310) (06663a7)

Features

2.0.0-beta.3 (2021-01-03)

Bug Fixes

Features

2.0.0-beta.2 (2021-01-02)

Bug Fixes

  • do not attempt to transform html requests (a7a5c5b)
  • fix spa fallback on paths ending with slash (60fe476)
  • resolve: prioritize browser field (dfef3de), closes #1154
  • resolve: resolve inline package (e27fe30), closes #1291
  • dynamic load postcss plugin (#1292) (00c7370), closes #1287
  • fix transform result check for empty result (2adfa8b), closes #1278

Code Refactoring

  • hmr: pass context object to handleHotUpdate plugin hook (b314771)

Reverts

  • Revert "types: worker types" (#1295) (806ef96), closes #1295

BREAKING CHANGES

  • hmr: handleHotUpdate plugin hook now receives a single HmrContext argument instead of multiple args.

2.0.0-beta.1 (2021-01-02)

Bug Fixes

Features

  • also call buildEnd on container close (94a8def)
  • provide default typing for supported file types (a9c7eac)
  • support resolveId returning arbitrary value (b782af4)

2.0.0-alpha.5 (2020-12-30)

Bug Fixes

  • css: properly prevent css from being tree-shaken (7f08835)

2.0.0-alpha.4 (2020-12-30)

Bug Fixes

  • css: fix cssCodeSplit: false (9a02203)
  • disable cssCodeSplit by default in lib mode (e64509a)
  • fix terser worker thread when vite is linked (a28419b)
  • inline assets in lib mode (c976d10)

2.0.0-alpha.3 (2020-12-30)

2.0.0-alpha.2 (2020-12-29)

Bug Fixes

  • plugin-vue: avoid throwing on never requested file (48a24c1)

2.0.0-alpha.1 (2020-12-29)

  • new universal plugin format
  • framework agnostic core
  • smaller and faster install
  • improved JS API
  • improved alias and resolving
  • improved page reload performance (strong caching of npm deps)
  • error overlay
  • better vue perf (single request in most cases)
  • multi entry mode
  • lib mode