Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vitejs/vite
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: plugin-vue-jsx@1.1.7
Choose a base ref
...
head repository: vitejs/vite
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: plugin-vue-jsx@1.1.8
Choose a head ref

Commits on Jul 27, 2021

  1. Copy the full SHA
    a825cf8 View commit details
  2. Copy the full SHA
    69a000f View commit details
  3. release: create-vite@2.5.3

    patak-dev committed Jul 27, 2021
    Copy the full SHA
    6cdca34 View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df3d937 View commit details
  5. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cd44691 View commit details
  6. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4454688 View commit details
  7. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    318cb43 View commit details

Commits on Jul 28, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e56b15d View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2986f6e View commit details
  3. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a06b26b View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    832d7f3 View commit details
  5. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ecbc869 View commit details
  6. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    31444ec View commit details

Commits on Jul 29, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb75dbd View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6d919cf View commit details
  3. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    024a2de View commit details

Commits on Jul 30, 2021

  1. chore: typo (#4445)

    bhbs authored Jul 30, 2021

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    67e5830 View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1134fd0 View commit details
  3. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6017ddb View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bd7c148 View commit details
  5. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6b98fdd View commit details
  6. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c0a3dbf View commit details

Commits on Jul 31, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7d340a6 View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    690b35e View commit details

Commits on Aug 1, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    304cc6b View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1e711c0 View commit details
  3. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a68861f View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3df736b View commit details

Commits on Aug 2, 2021

  1. fix: @vite/client http request is 404 not found (#4187)

    Co-authored-by: Shinigami <chrissi92@hotmail.de>
    ygj6 and Shinigami92 authored Aug 2, 2021

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    21ecdac View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d4e979f View commit details
  3. fix(deps): update all non-major dependencies (#4468)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored Aug 2, 2021

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cd54a22 View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a5d0e8f View commit details
  5. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a5b2b4f View commit details
  6. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    76dbef6 View commit details
  7. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f9e5d63 View commit details
  8. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cbd0458 View commit details
  9. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    40c51e1 View commit details
  10. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    59841f0 View commit details
  11. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d53dc92 View commit details
  12. feat(ssr): tolerate circular imports (#3950)

    Co-authored-by: Greg Fairbanks <gregfa@zillowgroup.com>
    Co-authored-by: Ray Thurne Void <ray.thurne.void@gmail.com>
    3 people authored Aug 2, 2021

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    69f91a1 View commit details

Commits on Aug 3, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5b85f0f View commit details
  2. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2faef0b View commit details
  3. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    056b17e View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    86f673a View commit details
  5. Copy the full SHA
    365e3ad View commit details
  6. release: create-vite@2.5.4

    patak-dev committed Aug 3, 2021
    Copy the full SHA
    442e7e7 View commit details
  7. release: v2.5.0-beta.0

    patak-dev committed Aug 3, 2021
    Copy the full SHA
    0c8656e View commit details
  8. Copy the full SHA
    db4ba56 View commit details
  9. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9e4572e View commit details
  10. Copy the full SHA
    c8e42d7 View commit details
Showing with 5,035 additions and 2,866 deletions.
  1. +1 −0 .eslintrc.js
  2. +5 −3 .github/ISSUE_TEMPLATE/bug_report.yml
  3. +1 −1 .github/ISSUE_TEMPLATE/feature_request.yml
  4. +2 −2 .github/PULL_REQUEST_TEMPLATE.md
  5. +17 −0 .github/semantic.yml
  6. +1 −1 .github/workflows/issue-labeled.yml
  7. +1 −1 .gitignore
  8. +6 −2 .github/contributing.md → CONTRIBUTING.md
  9. +1 −1 README.md
  10. +1 −1 docs/blog/announcing-vite2.md
  11. +51 −36 docs/config/index.md
  12. +8 −6 docs/guide/api-plugin.md
  13. +7 −5 docs/guide/backend-integration.md
  14. +11 −9 docs/guide/build.md
  15. +5 −0 docs/guide/dep-pre-bundling.md
  16. +3 −1 docs/guide/env-and-mode.md
  17. +35 −5 docs/guide/features.md
  18. +8 −6 docs/guide/migration.md
  19. +7 −0 docs/guide/ssr.md
  20. +22 −14 docs/guide/static-deploy.md
  21. +10 −7 docs/guide/using-plugins.md
  22. BIN docs/images/vercel-configuration.png
  23. +1 −0 jest.config.ts
  24. +32 −17 package.json
  25. +31 −1 packages/create-app/index.js
  26. +2 −2 packages/create-app/package.json
  27. +42 −0 packages/create-vite/CHANGELOG.md
  28. +29 −4 packages/create-vite/index.js
  29. +1 −1 packages/create-vite/package.json
  30. +1 −1 packages/create-vite/template-lit-element-ts/package.json
  31. +2 −1 packages/create-vite/template-lit-element-ts/tsconfig.json
  32. +1 −1 packages/create-vite/template-lit-element/package.json
  33. +1 −1 packages/create-vite/template-preact-ts/package.json
  34. +1 −0 packages/create-vite/template-preact-ts/tsconfig.json
  35. +1 −1 packages/create-vite/template-preact/package.json
  36. +1 −1 packages/create-vite/template-react-ts/package.json
  37. +1 −0 packages/create-vite/template-react-ts/tsconfig.json
  38. +1 −1 packages/create-vite/template-react/package.json
  39. +1 −1 packages/create-vite/template-svelte-ts/package.json
  40. +1 −0 packages/create-vite/template-svelte-ts/tsconfig.json
  41. +1 −1 packages/create-vite/template-svelte/package.json
  42. +1 −1 packages/create-vite/template-vanilla-ts/package.json
  43. +1 −0 packages/create-vite/template-vanilla-ts/tsconfig.json
  44. +1 −1 packages/create-vite/template-vanilla/package.json
  45. +3 −0 packages/create-vite/template-vue-ts/.vscode/extensions.json
  46. +3 −19 packages/create-vite/template-vue-ts/README.md
  47. +4 −4 packages/create-vite/template-vue-ts/package.json
  48. +6 −12 packages/create-vite/template-vue-ts/src/App.vue
  49. +8 −26 packages/create-vite/template-vue-ts/src/components/HelloWorld.vue
  50. +2 −0 packages/create-vite/template-vue-ts/src/{shims-vue.d.ts → env.d.ts}
  51. +0 −1 packages/create-vite/template-vue-ts/src/vite-env.d.ts
  52. +1 −0 packages/create-vite/template-vue-ts/tsconfig.json
  53. +3 −0 packages/create-vite/template-vue/.vscode/extensions.json
  54. +7 −0 packages/create-vite/template-vue/README.md
  55. +4 −4 packages/create-vite/template-vue/package.json
  56. +6 −7 packages/create-vite/template-vue/src/App.vue
  57. +18 −13 packages/create-vite/template-vue/src/components/HelloWorld.vue
  58. +1 −1 packages/playground/alias/package.json
  59. +13 −0 packages/playground/assets/__tests__/assets.spec.ts
  60. +18 −3 packages/playground/assets/index.html
  61. BIN packages/playground/assets/{static/white space.png → nested/テスト-測試-white space.png}
  62. +1 −0 packages/playground/assets/テスト-測試-white space.js
  63. +32 −1 packages/playground/backend-integration/__tests__/backend-integration.spec.ts
  64. +2 −0 packages/playground/backend-integration/frontend/entrypoints/global.css
  65. +2 −1 packages/playground/backend-integration/frontend/entrypoints/index.html
  66. +11 −0 packages/playground/backend-integration/frontend/entrypoints/main.ts
  67. +1 −0 packages/playground/backend-integration/frontend/styles/tailwind.css
  68. +3 −0 packages/playground/backend-integration/package.json
  69. +6 −0 packages/playground/backend-integration/postcss.config.js
  70. +12 −0 packages/playground/backend-integration/tailwind.config.js
  71. +67 −0 packages/playground/css/__tests__/css.spec.ts
  72. +3 −0 packages/playground/css/composed.module.css
  73. +3 −0 packages/playground/css/composed.module.less
  74. +3 −0 packages/playground/css/composed.module.scss
  75. +11 −0 packages/playground/css/composes-path-resolving.module.css
  76. +15 −0 packages/playground/css/index.html
  77. +15 −0 packages/playground/css/main.js
  78. +3 −0 packages/playground/css/pkg-dep/_index.scss
  79. 0 packages/playground/css/pkg-dep/index.js
  80. +5 −0 packages/playground/css/pkg-dep/package.json
  81. +1 −0 packages/playground/css/sass.scss
  82. +6 −0 packages/playground/define/__tests__/define.spec.ts
  83. +9 −0 packages/playground/define/index.html
  84. +10 −0 packages/playground/dynamic-import/__tests__/dynamic-import.spec.ts
  85. +2 −0 packages/playground/dynamic-import/css/index.css
  86. +1 −0 packages/playground/dynamic-import/index.html
  87. +5 −0 packages/playground/dynamic-import/nested/index.js
  88. +1 −0 packages/playground/env/.env
  89. +5 −0 packages/playground/env/__tests__/env.spec.ts
  90. +2 −0 packages/playground/env/index.html
  91. +5 −0 packages/playground/env/vite.config.js
  92. +10 −0 packages/playground/extensions/__tests__/extensions.spec.ts
  93. +6 −0 packages/playground/extensions/index.html
  94. +14 −0 packages/playground/extensions/package.json
  95. +6 −0 packages/playground/extensions/vite.config.js
  96. +20 −0 packages/playground/legacy/__tests__/ssr/legacy-ssr.spec.ts
  97. +52 −0 packages/playground/legacy/__tests__/ssr/serve.js
  98. +7 −0 packages/playground/legacy/entry-server.js
  99. +0 −1 packages/playground/multiple-entrypoints/vite.config.js
  100. +2 −0 packages/playground/nested-deps/__tests__/nested-deps.spec.ts
  101. +10 −0 packages/playground/nested-deps/index.html
  102. +2 −1 packages/playground/nested-deps/package.json
  103. +3 −0 packages/playground/nested-deps/test-package-d/index.js
  104. +8 −0 packages/playground/nested-deps/test-package-d/package.json
  105. +1 −0 packages/playground/nested-deps/test-package-d/test-package-d-nested/index.js
  106. +5 −0 packages/playground/nested-deps/test-package-d/test-package-d-nested/package.json
  107. +4 −2 packages/playground/nested-deps/vite.config.js
  108. +16 −0 packages/playground/optimize-deps/__tests__/optimize-deps.spec.ts
  109. +12 −0 packages/playground/optimize-deps/cjs-dynamic.js
  110. +5 −0 packages/playground/optimize-deps/dep-cjs-compiled-from-cjs/index.js
  111. +5 −0 packages/playground/optimize-deps/dep-cjs-compiled-from-cjs/package.json
  112. +6 −0 packages/playground/optimize-deps/dep-cjs-compiled-from-esm/index.js
  113. +5 −0 packages/playground/optimize-deps/dep-cjs-compiled-from-esm/package.json
  114. +10 −0 packages/playground/optimize-deps/index.html
  115. +3 −0 packages/playground/optimize-deps/nested-exclude/index.js
  116. +2 −0 packages/playground/optimize-deps/nested-exclude/nested-include/index.js
  117. +5 −0 packages/playground/optimize-deps/nested-exclude/nested-include/package.json
  118. +8 −0 packages/playground/optimize-deps/nested-exclude/package.json
  119. +4 −2 packages/playground/optimize-deps/package.json
  120. +3 −1 packages/playground/optimize-deps/vite.config.js
  121. +2 −2 packages/playground/preload/package.json
  122. +8 −1 packages/playground/ssr-react/__tests__/ssr-react.spec.ts
  123. +9 −0 packages/playground/ssr-react/src/add.js
  124. +1 −0 packages/playground/ssr-react/src/circular-dep-init/README.md
  125. +2 −0 packages/playground/ssr-react/src/circular-dep-init/circular-dep-init.js
  126. +1 −0 packages/playground/ssr-react/src/circular-dep-init/module-a.js
  127. +8 −0 packages/playground/ssr-react/src/circular-dep-init/module-b.js
  128. +45 −0 packages/playground/ssr-react/src/forked-deadlock/README.md
  129. +10 −0 packages/playground/ssr-react/src/forked-deadlock/common-module.js
  130. +8 −0 packages/playground/ssr-react/src/forked-deadlock/deadlock-fuse-module.js
  131. +8 −0 packages/playground/ssr-react/src/forked-deadlock/fuse-stuck-bridge-module.js
  132. +8 −0 packages/playground/ssr-react/src/forked-deadlock/middle-module.js
  133. +8 −0 packages/playground/ssr-react/src/forked-deadlock/stuck-module.js
  134. +9 −0 packages/playground/ssr-react/src/multiply.js
  135. +10 −1 packages/playground/ssr-react/src/pages/About.jsx
  136. +15 −1 packages/playground/ssr-react/src/pages/Home.jsx
  137. +3 −3 packages/playground/ssr-vue/package.json
  138. +48 −0 packages/playground/ssr-webworker/__tests__/serve.js
  139. +10 −0 packages/playground/ssr-webworker/__tests__/ssr-webworker.spec.ts
  140. +15 −0 packages/playground/ssr-webworker/package.json
  141. +19 −0 packages/playground/ssr-webworker/src/entry-worker.jsx
  142. +23 −0 packages/playground/ssr-webworker/vite.config.js
  143. +26 −0 packages/playground/ssr-webworker/worker.js
  144. +2 −2 packages/playground/tailwind/package.json
  145. +10 −9 packages/playground/testUtils.ts
  146. +16 −0 packages/playground/tsconfig-json/__tests__/tsconfig-json.spec.ts
  147. +12 −0 packages/playground/tsconfig-json/index.html
  148. +17 −0 packages/playground/tsconfig-json/nested-with-extends/main.ts
  149. +3 −0 packages/playground/tsconfig-json/nested-with-extends/not-used-type.ts
  150. +7 −0 packages/playground/tsconfig-json/nested-with-extends/tsconfig.json
  151. +17 −0 packages/playground/tsconfig-json/nested/main.ts
  152. +3 −0 packages/playground/tsconfig-json/nested/not-used-type.ts
  153. +21 −0 packages/playground/tsconfig-json/nested/tsconfig.json
  154. +11 −0 packages/playground/tsconfig-json/package.json
  155. +20 −0 packages/playground/tsconfig-json/src/main.ts
  156. +3 −0 packages/playground/tsconfig-json/src/not-used-type.ts
  157. +20 −0 packages/playground/tsconfig-json/tsconfig.json
  158. +14 −0 packages/playground/vue-jsx/Script.vue
  159. +12 −0 packages/playground/vue-jsx/SrcImport.jsx
  160. +1 −0 packages/playground/vue-jsx/SrcImport.vue
  161. +28 −0 packages/playground/vue-jsx/__tests__/vue-jsx.spec.ts
  162. +4 −0 packages/playground/vue-jsx/main.jsx
  163. +2 −1 packages/playground/vue-jsx/package.json
  164. +3 −1 packages/playground/vue-jsx/vite.config.js
  165. +26 −0 packages/playground/vue/CustomElement.ce.vue
  166. +2 −0 packages/playground/vue/Main.vue
  167. +9 −0 packages/playground/vue/RefTransform.vue
  168. +16 −0 packages/playground/vue/__tests__/vue.spec.ts
  169. +4 −1 packages/playground/vue/index.html
  170. +2 −2 packages/playground/vue/package.json
  171. +7 −2 packages/playground/vue/vite.config.ts
  172. +1 −0 packages/playground/worker/__tests__/worker.spec.ts
  173. +29 −0 packages/plugin-legacy/CHANGELOG.md
  174. +4 −4 packages/plugin-legacy/README.md
  175. +27 −7 packages/plugin-legacy/index.js
  176. +3 −3 packages/plugin-legacy/package.json
  177. +9 −0 packages/plugin-react-refresh/CHANGELOG.md
  178. +2 −2 packages/plugin-react-refresh/package.json
  179. +9 −0 packages/plugin-vue-jsx/CHANGELOG.md
  180. +1 −1 packages/plugin-vue-jsx/index.js
  181. +1 −1 packages/plugin-vue-jsx/package.json
  182. +36 −0 packages/plugin-vue/CHANGELOG.md
  183. +27 −7 packages/plugin-vue/README.md
  184. +3 −3 packages/plugin-vue/package.json
  185. +8 −1 packages/plugin-vue/src/handleHotUpdate.ts
  186. +61 −12 packages/plugin-vue/src/index.ts
  187. +2 −11 packages/plugin-vue/src/main.ts
  188. +1 −0 packages/plugin-vue/src/script.ts
  189. +3 −2 packages/plugin-vue/src/template.ts
  190. +150 −0 packages/vite/CHANGELOG.md
  191. +139 −115 packages/vite/LICENSE.md
  192. +23 −0 packages/vite/client.d.ts
  193. +13 −13 packages/vite/package.json
  194. +30 −6 packages/vite/rollup.config.js
  195. +3 −3 packages/vite/src/client/client.ts
  196. +3 −1 packages/vite/src/client/overlay.ts
  197. +156 −0 packages/vite/src/node/__tests__/asset.spec.ts
  198. +26 −1 packages/vite/src/node/__tests__/config.spec.ts
  199. +74 −1 packages/vite/src/node/__tests__/plugins/css.spec.ts
  200. +20 −1 packages/vite/src/node/__tests__/scan.spec.ts
  201. +19 −13 packages/vite/src/node/build.ts
  202. +35 −36 packages/vite/src/node/cli.ts
  203. +79 −16 packages/vite/src/node/config.ts
  204. +6 −1 packages/vite/src/node/constants.ts
  205. +2 −1 packages/vite/src/node/index.ts
  206. +20 −3 packages/vite/src/node/logger.ts
  207. +31 −9 packages/vite/src/node/optimizer/index.ts
  208. +1 −1 packages/vite/src/node/optimizer/registerMissing.ts
  209. +38 −10 packages/vite/src/node/optimizer/scan.ts
  210. +91 −6 packages/vite/src/node/plugins/asset.ts
  211. +7 −4 packages/vite/src/node/plugins/assetImportMetaUrl.ts
  212. +4 −5 packages/vite/src/node/plugins/clientInjections.ts
  213. +50 −29 packages/vite/src/node/plugins/css.ts
  214. +2 −1 packages/vite/src/node/plugins/define.ts
  215. +0 −144 packages/vite/src/node/plugins/dynamicImportPolyfill.ts
  216. +236 −0 packages/vite/src/node/plugins/esbuild.ts
  217. +5 −5 packages/vite/src/node/plugins/html.ts
  218. +12 −1 packages/vite/src/node/plugins/importAnalysis.ts
  219. +36 −20 packages/vite/src/node/plugins/importAnalysisBuild.ts
  220. +5 −3 packages/vite/src/node/plugins/index.ts
  221. +100 −0 packages/vite/src/node/plugins/modulePreloadPolyfill.ts
  222. +2 −2 packages/vite/src/node/plugins/preAlias.ts
  223. +5 −5 packages/vite/src/node/plugins/reporter.ts
  224. +189 −96 packages/vite/src/node/plugins/resolve.ts
  225. +10 −7 packages/vite/src/node/plugins/worker.ts
  226. +3 −3 packages/vite/src/node/preview.ts
  227. +14 −19 packages/vite/src/node/server/hmr.ts
  228. +12 −10 packages/vite/src/node/server/index.ts
  229. +5 −2 packages/vite/src/node/server/middlewares/base.ts
  230. +0 −19 packages/vite/src/node/server/middlewares/decodeURI.ts
  231. +2 −1 packages/vite/src/node/server/middlewares/error.ts
  232. +2 −1 packages/vite/src/node/server/middlewares/proxy.ts
  233. +10 −5 packages/vite/src/node/server/middlewares/static.ts
  234. +21 −20 packages/vite/src/node/server/middlewares/transform.ts
  235. +5 −4 packages/vite/src/node/server/openBrowser.ts
  236. +19 −8 packages/vite/src/node/server/pluginContainer.ts
  237. +4 −2 packages/vite/src/node/server/ws.ts
  238. +40 −32 packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts
  239. +12 −7 packages/vite/src/node/ssr/ssrExternal.ts
  240. +47 −35 packages/vite/src/node/ssr/ssrModuleLoader.ts
  241. +28 −22 packages/vite/src/node/ssr/ssrTransform.ts
  242. +50 −7 packages/vite/src/node/utils.ts
  243. +5 −0 packages/vite/types/anymatch.d.ts
  244. +2 −1 packages/vite/types/chokidar.d.ts
  245. +0 −587 packages/vite/types/clean-css.d.ts
  246. +3 −3 packages/vite/types/http-proxy.d.ts
  247. +0 −5 packages/vite/types/shims.d.ts
  248. +1,384 −1,198 yarn.lock
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ module.exports = defineConfig({
'error',
{ allow: ['arrowFunctions'] }
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off', // maybe we should turn this on in a new PR
'@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier
'@typescript-eslint/no-inferrable-types': 'off',
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ body:
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to a repo that can reproduce the problem you ran into. A reproduction is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
description: Please provide a link to a repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
placeholder: Reproduction
validations:
required: true
@@ -60,13 +60,15 @@ body:
options:
- label: Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md).
- label: Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
required: true
- label: Read the [docs](https://vitejs.dev/guide).
required: true
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- label: Check that there isn't [already an issue](https://github.com/vitejs/vite/issues) that reports the same bug to avoid creating a duplicate.
required: true
- label: Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
required: true
- label: Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitejs/vite/discussions) or join our [Discord Chat Server](https://chat.vitejs.dev/).
required: true
- label: The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ body:
options:
- label: Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md).
- label: Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
required: true
- label: Read the [docs](https://vitejs.dev/guide).
required: true
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@

### Before submitting the PR, please make sure you do the following

- [ ] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md).
- [ ] Read the [Pull Request Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md#pull-request-guidelines) and follow the [Commit Convention](https://github.com/vitejs/vite/blob/main/.github/commit-convention.md).
- [ ] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).
- [ ] Read the [Pull Request Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md#pull-request-guidelines) and follow the [Commit Convention](https://github.com/vitejs/vite/blob/main/.github/commit-convention.md).
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
17 changes: 17 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
titleOnly: true
types:
- feat
- fix
- docs
- dx
- refactor
- perf
- test
- workflow
- build
- ci
- chore
- types
- wip
- release
- deps

2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
@@ -36,5 +36,5 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide a minimal reproduction using a GitHub repository or [codesandbox](https://codesandbox.io). Issues marked with `need reproduction` will be closed if they have no activity within 3 days.
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://vite.new). Issues marked with `need reproduction` will be closed if they have no activity within 3 days.
labels: "pending triage"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@ explorations
*.local
/packages/vite/LICENSE
*.cpuprofile
.vscode/
/.vscode/
8 changes: 6 additions & 2 deletions .github/contributing.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -75,6 +75,10 @@ test('?raw import', async () => {
})
```

## Debug Logging

You can set the `DEBUG` environment variable to turn on debugging logs. E.g. `DEBUG="vite:resolve"`. To see all debug logs you can set `DEBUG="vite:*"`, but be warned that it will be quite noisy. You can run `grep -r "createDebugger('vite:" packages/vite/src/` to see a list of available debug scopes.

## Pull Request Guidelines

- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
@@ -104,11 +108,11 @@ test('?raw import', async () => {
### Issue Triaging Workflow

![issue-workflow](./issue-workflow.png)
![issue-workflow](./.github/issue-workflow.png)

### Pull Request Review Workflow

![issue-workflow](./pr-workflow.png)
![issue-workflow](./.github/pr-workflow.png)

## Notes on Dependencies

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ Check out the [Migration Guide](https://vitejs.dev/guide/migration.html) if you

## Contribution

See [Contributing Guide](https://github.com/vitejs/vite/tree/main/.github/contributing.md).
See [Contributing Guide](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md).

## License

2 changes: 1 addition & 1 deletion docs/blog/announcing-vite2.md
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ Vite treats CSS as a first-class citizen of the module graph and supports the fo

### Server-Side Rendering (SSR) Support

Vite 2.0 ships with [experimental SSR support](https://vitejs.dev/guide/ssr.html). Vite provides APIs to to efficiently load and update ESM-based source code in Node.js during development (almost like server-side HMR), and automatically externalizes CommonJS-compatible dependencies to improve development and SSR build speed. The production server can be completely decoupled from Vite, and the same setup can be easily adapted to perform pre-rendering / SSG.
Vite 2.0 ships with [experimental SSR support](https://vitejs.dev/guide/ssr.html). Vite provides APIs to efficiently load and update ESM-based source code in Node.js during development (almost like server-side HMR), and automatically externalizes CommonJS-compatible dependencies to improve development and SSR build speed. The production server can be completely decoupled from Vite, and the same setup can be easily adapted to perform pre-rendering / SSG.

Vite SSR is provided as a low-level feature and we are expecting to see higher level frameworks leveraging it under the hood.

87 changes: 51 additions & 36 deletions docs/config/index.md
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ Vite also directly supports TS config files. You can use `vite.config.ts` with t
If the config needs to conditional determine options based on the command (`serve` or `build`) or the [mode](/guide/env-and-mode) being used, it can export a function instead:

```js
export default ({ command, mode }) => {
export default defineConfig(({ command, mode }) => {
if (command === 'serve') {
return {
// serve specific config
@@ -65,20 +65,20 @@ export default ({ command, mode }) => {
// build specific config
}
}
}
})
```

### Async Config

If the config needs to call async function, it can export a async function instead:

```js
export default async ({ command, mode }) => {
export default defineConfig(async ({ command, mode }) => {
const data = await asyncFunction()
return {
// build specific config
}
}
})
```

## Shared Options
@@ -213,7 +213,7 @@ export default async ({ command, mode }) => {
```ts
interface CSSModulesOptions {
scopeBehaviour?: 'global' | 'local'
globalModulePaths?: string[]
globalModulePaths?: RegExp[]
generateScopedName?:
| string
| ((name: string, filename: string, css: string) => string)
@@ -242,15 +242,15 @@ export default async ({ command, mode }) => {
Specify options to pass to CSS pre-processors. Example:

```js
export default {
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData: `$injectedColor: orange;`
}
}
}
}
})
```

### json.namedExports
@@ -276,24 +276,24 @@ export default async ({ command, mode }) => {
`ESBuildOptions` extends [ESbuild's own transform options](https://esbuild.github.io/api/#transform-api). The most common use case is customizing JSX:

```js
export default {
export default defineConfig({
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment'
}
}
})
```

By default, ESBuild is applied to `ts`, `jsx` and `tsx` files. You can customize this with `esbuild.include` and `esbuild.exclude`, both of which expect type of `string | RegExp | (string | RegExp)[]`.

In addition, you can also use `esbuild.jsxInject` to automatically inject JSX helper imports for every file transformed by ESBuild:

```js
export default {
export default defineConfig({
esbuild: {
jsxInject: `import React from 'react'`
}
}
})
```

Set to `false` to disable ESbuild transforms.
@@ -333,6 +333,18 @@ export default async ({ command, mode }) => {

See [here](/guide/env-and-mode#env-files) for more about environment files.

### envPrefix

- **Type:** `string | string[]`
- **Default:** `VITE_`

Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.

:::warning SECURITY NOTES

- `envPrefix` should not be set as `''`, which will expose all your env variables and cause unexpected leaking of of sensitive information. Vite will throw error when detecting `''`.
:::

## Server Options

### server.host
@@ -374,11 +386,11 @@ export default async ({ command, mode }) => {
**Example:**

```js
export default {
export default defineConfig({
server: {
open: '/docs/index.html'
}
}
})
```

### server.proxy
@@ -392,11 +404,11 @@ export default async ({ command, mode }) => {
**Example:**

```js
export default {
export default defineConfig({
server: {
proxy: {
// string shorthand
'/foo': 'http://localhost:4567/foo',
'/foo': 'http://localhost:4567',
// with options
'/api': {
target: 'http://jsonplaceholder.typicode.com',
@@ -415,11 +427,11 @@ export default async ({ command, mode }) => {
changeOrigin: true,
configure: (proxy, options) => {
// proxy will be an instance of 'http-proxy'
}),
}
}
}
}
}
})
```

### server.cors
@@ -453,6 +465,8 @@ export default async ({ command, mode }) => {

File system watcher options to pass on to [chokidar](https://github.com/paulmillr/chokidar#api).

When running Vite on Windows Subsystem for Linux (WSL) 2, if the project folder resides in a Windows filesystem, you'll need to set this option to `{ usePolling: true }`. This is due to [a WSL2 limitation](https://github.com/microsoft/WSL/issues/4739) with the Windows filesystem.

### server.middlewareMode

- **Type:** `'ssr' | 'html'`
@@ -514,21 +528,21 @@ createServer()
Accepts a path to specify the custom workspace root. Could be a absolute path or a path relative to [project root](/guide/#index-html-and-project-root). For example

```js
export default {
export default defineConfig({
server: {
fs: {
// Allow serving files from one level up to the project root
allow: ['..']
}
}
}
})
```

## Build Options

### build.target

- **Type:** `string`
- **Type:** `string | string[]`
- **Default:** `'modules'`
- **Related:** [Browser Compatibility](/guide/build#browser-compatibility)

@@ -543,21 +557,19 @@ createServer()

Note the build will fail if the code contains features that cannot be safely transpiled by esbuild. See [esbuild docs](https://esbuild.github.io/content-types/#javascript) for more details.

### build.polyfillDynamicImport
### build.polyfillModulePreload

- **Type:** `boolean`
- **Default:** `false`
- **Default:** `true`

Whether to automatically inject [dynamic import polyfill](https://github.com/GoogleChromeLabs/dynamic-import-polyfill).
Whether to automatically inject [module preload polyfill](https://guybedford.com/es-module-preloading-integrity#modulepreload-polyfill).

If set to true, the polyfill is auto injected into the proxy module of each `index.html` entry. If the build is configured to use a non-html custom entry via `build.rollupOptions.input`, then it is necessary to manually import the polyfill in your custom entry:
If set to `true`, the polyfill is auto injected into the proxy module of each `index.html` entry. If the build is configured to use a non-html custom entry via `build.rollupOptions.input`, then it is necessary to manually import the polyfill in your custom entry:

```js
import 'vite/dynamic-import-polyfill'
import 'vite/modulepreload-polyfill'
```

When using [`@vitejs/plugin-legacy`](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy), the plugin sets this option to `true` automatically.

Note: the polyfill does **not** apply to [Library Mode](/guide/build#library-mode). If you need to support browsers without native dynamic import, you should probably avoid using it in your library.

### build.outDir
@@ -647,12 +659,6 @@ createServer()

Additional [minify options](https://terser.org/docs/api-reference#minify-options) to pass on to Terser.

### build.cleanCssOptions

- **Type:** `CleanCSS.Options`

Constructor options to pass on to [clean-css](https://github.com/jakubpawlowicz/clean-css#constructor-options).

### build.write

- **Type:** `boolean`
@@ -707,7 +713,16 @@ createServer()
Dependencies to exclude from pre-bundling.

:::warning CommonJS
CommonJS dependencies should not be excluded from optimization. If an ESM dependency has a nested CommonJS dependency, it should not be excluded as well.
CommonJS dependencies should not be excluded from optimization. If an ESM dependency is excluded from optimization, but has a nested CommonJS dependency, the CommonJS dependency should be added to `optimizeDeps.include`. Example:

```js
export default defineConfig({
optimizeDeps: {
include: ['esm-dep > cjs-dep']
}
})
```

:::

### optimizeDeps.include
@@ -741,9 +756,9 @@ SSR options may be adjusted in minor releases.

### ssr.noExternal

- **Type:** `string | RegExp | (string | RegExp)[]`
- **Type:** `string | RegExp | (string | RegExp)[] | true`

Prevent listed dependencies from being externalized for SSR.
Prevent listed dependencies from being externalized for SSR. If `true`, no dependencies are externalized.

### ssr.target

Loading