vite 6.0.0-beta.1 → 6.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -3,7 +3,7 @@ Vite is released under the MIT license:
3
3
 
4
4
  MIT License
5
5
 
6
- Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
6
+ Copyright (c) 2019-present, VoidZero Inc. and Vite contributors
7
7
 
8
8
  Permission is hereby granted, free of charge, to any person obtaining a copy
9
9
  of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@ SOFTWARE.
25
25
 
26
26
  # Licenses of bundled dependencies
27
27
  The published Vite artifact additionally contains code with the following licenses:
28
- Apache-2.0, BSD-2-Clause, BlueOak-1.0.0, CC0-1.0, ISC, MIT
28
+ Apache-2.0, BSD-2-Clause, CC0-1.0, ISC, MIT
29
29
 
30
30
  # Bundled dependencies:
31
31
  ## @ampproject/remapping
@@ -684,35 +684,6 @@ Repository: https://github.com/davidbonnet/astring.git
684
684
 
685
685
  ---------------------------------------
686
686
 
687
- ## balanced-match
688
- License: MIT
689
- By: Julian Gruber
690
- Repository: git://github.com/juliangruber/balanced-match.git
691
-
692
- > (MIT)
693
- >
694
- > Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
695
- >
696
- > Permission is hereby granted, free of charge, to any person obtaining a copy of
697
- > this software and associated documentation files (the "Software"), to deal in
698
- > the Software without restriction, including without limitation the rights to
699
- > use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
700
- > of the Software, and to permit persons to whom the Software is furnished to do
701
- > so, subject to the following conditions:
702
- >
703
- > The above copyright notice and this permission notice shall be included in all
704
- > copies or substantial portions of the Software.
705
- >
706
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
707
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
708
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
709
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
710
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
711
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
712
- > SOFTWARE.
713
-
714
- ---------------------------------------
715
-
716
687
  ## binary-extensions
717
688
  License: MIT
718
689
  By: Sindre Sorhus
@@ -730,35 +701,6 @@ Repository: sindresorhus/binary-extensions
730
701
 
731
702
  ---------------------------------------
732
703
 
733
- ## brace-expansion
734
- License: MIT
735
- By: Julian Gruber
736
- Repository: git://github.com/juliangruber/brace-expansion.git
737
-
738
- > MIT License
739
- >
740
- > Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
741
- >
742
- > Permission is hereby granted, free of charge, to any person obtaining a copy
743
- > of this software and associated documentation files (the "Software"), to deal
744
- > in the Software without restriction, including without limitation the rights
745
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
746
- > copies of the Software, and to permit persons to whom the Software is
747
- > furnished to do so, subject to the following conditions:
748
- >
749
- > The above copyright notice and this permission notice shall be included in all
750
- > copies or substantial portions of the Software.
751
- >
752
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
753
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
754
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
755
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
756
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
757
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
758
- > SOFTWARE.
759
-
760
- ---------------------------------------
761
-
762
704
  ## braces
763
705
  License: MIT
764
706
  By: Jon Schlinkert, Brian Woodward, Elan Shanker, Eugene Sharygin, hemanth.hm
@@ -1385,6 +1327,21 @@ Repository: git+https://github.com/mcollina/fastq.git
1385
1327
 
1386
1328
  ---------------------------------------
1387
1329
 
1330
+ ## fdir
1331
+ License: MIT
1332
+ By: thecodrr
1333
+ Repository: git+https://github.com/thecodrr/fdir.git
1334
+
1335
+ > Copyright 2023 Abdullah Atta
1336
+ >
1337
+ > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1338
+ >
1339
+ > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1340
+ >
1341
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1342
+
1343
+ ---------------------------------------
1344
+
1388
1345
  ## fill-range
1389
1346
  License: MIT
1390
1347
  By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling
@@ -1499,29 +1456,6 @@ Repository: git+https://github.com/css-modules/generic-names.git
1499
1456
 
1500
1457
  ---------------------------------------
1501
1458
 
1502
- ## glob
1503
- License: ISC
1504
- By: Isaac Z. Schlueter
1505
- Repository: git://github.com/isaacs/node-glob.git
1506
-
1507
- > The ISC License
1508
- >
1509
- > Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors
1510
- >
1511
- > Permission to use, copy, modify, and/or distribute this software for any
1512
- > purpose with or without fee is hereby granted, provided that the above
1513
- > copyright notice and this permission notice appear in all copies.
1514
- >
1515
- > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1516
- > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1517
- > MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1518
- > ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1519
- > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1520
- > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
1521
- > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1522
-
1523
- ---------------------------------------
1524
-
1525
1459
  ## glob-parent
1526
1460
  License: ISC
1527
1461
  By: Gulp Team, Elan Shanker, Blaine Bublitz
@@ -1956,29 +1890,6 @@ Repository: lodash/lodash
1956
1890
 
1957
1891
  ---------------------------------------
1958
1892
 
1959
- ## lru-cache
1960
- License: ISC
1961
- By: Isaac Z. Schlueter
1962
- Repository: git://github.com/isaacs/node-lru-cache.git
1963
-
1964
- > The ISC License
1965
- >
1966
- > Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors
1967
- >
1968
- > Permission to use, copy, modify, and/or distribute this software for any
1969
- > purpose with or without fee is hereby granted, provided that the above
1970
- > copyright notice and this permission notice appear in all copies.
1971
- >
1972
- > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1973
- > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1974
- > MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1975
- > ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1976
- > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1977
- > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
1978
- > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1979
-
1980
- ---------------------------------------
1981
-
1982
1893
  ## magic-string
1983
1894
  License: MIT
1984
1895
  By: Rich Harris
@@ -2051,52 +1962,6 @@ Repository: micromatch/micromatch
2051
1962
 
2052
1963
  ---------------------------------------
2053
1964
 
2054
- ## minimatch
2055
- License: ISC
2056
- By: Isaac Z. Schlueter
2057
- Repository: git://github.com/isaacs/minimatch.git
2058
-
2059
- > The ISC License
2060
- >
2061
- > Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
2062
- >
2063
- > Permission to use, copy, modify, and/or distribute this software for any
2064
- > purpose with or without fee is hereby granted, provided that the above
2065
- > copyright notice and this permission notice appear in all copies.
2066
- >
2067
- > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
2068
- > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
2069
- > MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
2070
- > ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
2071
- > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
2072
- > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
2073
- > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2074
-
2075
- ---------------------------------------
2076
-
2077
- ## minipass
2078
- License: ISC
2079
- By: Isaac Z. Schlueter
2080
- Repository: https://github.com/isaacs/minipass
2081
-
2082
- > The ISC License
2083
- >
2084
- > Copyright (c) 2017-2023 npm, Inc., Isaac Z. Schlueter, and Contributors
2085
- >
2086
- > Permission to use, copy, modify, and/or distribute this software for any
2087
- > purpose with or without fee is hereby granted, provided that the above
2088
- > copyright notice and this permission notice appear in all copies.
2089
- >
2090
- > THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
2091
- > WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
2092
- > MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
2093
- > ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
2094
- > WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
2095
- > ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
2096
- > IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2097
-
2098
- ---------------------------------------
2099
-
2100
1965
  ## mlly
2101
1966
  License: MIT
2102
1967
  Repository: unjs/mlly
@@ -2363,69 +2228,6 @@ Repository: sindresorhus/path-key
2363
2228
 
2364
2229
  ---------------------------------------
2365
2230
 
2366
- ## path-scurry
2367
- License: BlueOak-1.0.0
2368
- By: Isaac Z. Schlueter
2369
- Repository: git+https://github.com/isaacs/path-scurry
2370
-
2371
- > # Blue Oak Model License
2372
- >
2373
- > Version 1.0.0
2374
- >
2375
- > ## Purpose
2376
- >
2377
- > This license gives everyone as much permission to work with
2378
- > this software as possible, while protecting contributors
2379
- > from liability.
2380
- >
2381
- > ## Acceptance
2382
- >
2383
- > In order to receive this license, you must agree to its
2384
- > rules. The rules of this license are both obligations
2385
- > under that agreement and conditions to your license.
2386
- > You must not do anything with this software that triggers
2387
- > a rule that you cannot or will not follow.
2388
- >
2389
- > ## Copyright
2390
- >
2391
- > Each contributor licenses you to do everything with this
2392
- > software that would otherwise infringe that contributor's
2393
- > copyright in it.
2394
- >
2395
- > ## Notices
2396
- >
2397
- > You must ensure that everyone who gets a copy of
2398
- > any part of this software from you, with or without
2399
- > changes, also gets the text of this license or a link to
2400
- > <https://blueoakcouncil.org/license/1.0.0>.
2401
- >
2402
- > ## Excuse
2403
- >
2404
- > If anyone notifies you in writing that you have not
2405
- > complied with [Notices](#notices), you can keep your
2406
- > license by taking all practical steps to comply within 30
2407
- > days after the notice. If you do not do so, your license
2408
- > ends immediately.
2409
- >
2410
- > ## Patent
2411
- >
2412
- > Each contributor licenses you to do everything with this
2413
- > software that would otherwise infringe any patent claims
2414
- > they can license or become able to license.
2415
- >
2416
- > ## Reliability
2417
- >
2418
- > No contributor can revoke this license.
2419
- >
2420
- > ## No Liability
2421
- >
2422
- > ***As far as the law allows, this software comes as is,
2423
- > without any warranty or condition, and no contributor
2424
- > will be liable to anyone for any damages related to this
2425
- > software or this license, under any kind of legal claim.***
2426
-
2427
- ---------------------------------------
2428
-
2429
2231
  ## periscopic
2430
2232
  License: MIT
2431
2233
  Repository: Rich-Harris/periscopic
package/README.md CHANGED
@@ -11,10 +11,10 @@
11
11
 
12
12
  Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
13
13
 
14
- - A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vitejs.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vitejs.dev/guide/features.html#hot-module-replacement).
14
+ - A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vite.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features.html#hot-module-replacement).
15
15
 
16
- - A [build command](https://vitejs.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
16
+ - A [build command](https://vite.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
17
17
 
18
- In addition, Vite is highly extensible via its [Plugin API](https://vitejs.dev/guide/api-plugin.html) and [JavaScript API](https://vitejs.dev/guide/api-javascript.html) with full typing support.
18
+ In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/guide/api-plugin.html) and [JavaScript API](https://vite.dev/guide/api-javascript.html) with full typing support.
19
19
 
20
- [Read the Docs to Learn More](https://vitejs.dev).
20
+ [Read the Docs to Learn More](https://vite.dev).
package/bin/vite.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { performance } from 'node:perf_hooks'
3
+ import module from 'node:module'
3
4
 
4
5
  if (!import.meta.url.includes('node_modules')) {
5
6
  try {
@@ -41,6 +42,9 @@ if (debugIndex > 0) {
41
42
  }
42
43
 
43
44
  function start() {
45
+ try {
46
+ module.enableCompileCache?.()
47
+ } catch {}
44
48
  return import('../dist/node/cli.js')
45
49
  }
46
50
 
@@ -94,9 +94,7 @@ class HMRContext {
94
94
  removeFromMap(this.newListeners);
95
95
  }
96
96
  send(event, data) {
97
- this.hmrClient.messenger.send(
98
- JSON.stringify({ type: "custom", event, data })
99
- );
97
+ this.hmrClient.messenger.send({ type: "custom", event, data });
100
98
  }
101
99
  acceptDeps(deps, callback = () => {
102
100
  }) {
@@ -116,8 +114,8 @@ class HMRMessenger {
116
114
  this.connection = connection;
117
115
  this.queue = [];
118
116
  }
119
- send(message) {
120
- this.queue.push(message);
117
+ send(payload) {
118
+ this.queue.push(payload);
121
119
  this.flush();
122
120
  }
123
121
  flush() {
@@ -516,14 +514,14 @@ try {
516
514
  your current setup:
517
515
  (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)
518
516
  (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)
519
- Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .`
517
+ Check out your Vite / network configuration and https://vite.dev/config/server-options.html#server-hmr .`
520
518
  );
521
519
  });
522
520
  socket.addEventListener(
523
521
  "open",
524
522
  () => {
525
523
  console.info(
526
- "[vite] Direct websocket connection fallback. Check out https://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error."
524
+ "[vite] Direct websocket connection fallback. Check out https://vite.dev/config/server-options.html#server-hmr to remove the previous connection error."
527
525
  );
528
526
  },
529
527
  { once: true }
@@ -564,7 +562,7 @@ function setupWebSocket(protocol, hostAndPath, onCloseWithoutOpen) {
564
562
  return socket2;
565
563
  }
566
564
  function cleanUrl(pathname) {
567
- const url = new URL(pathname, "http://vitejs.dev");
565
+ const url = new URL(pathname, "http://vite.dev");
568
566
  url.searchParams.delete("direct");
569
567
  return url.pathname + url.search;
570
568
  }
@@ -590,7 +588,7 @@ const hmrClient = new HMRClient(
590
588
  },
591
589
  {
592
590
  isReady: () => socket && socket.readyState === 1,
593
- send: (message) => socket.send(message)
591
+ send: (payload) => socket.send(JSON.stringify(payload))
594
592
  },
595
593
  async function importUpdatedModule({
596
594
  acceptedPath,
@@ -824,7 +822,7 @@ function injectQuery(url, queryToInject) {
824
822
  return url;
825
823
  }
826
824
  const pathname = url.replace(/[?#].*$/, "");
827
- const { search, hash } = new URL(url, "http://vitejs.dev");
825
+ const { search, hash } = new URL(url, "http://vite.dev");
828
826
  return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
829
827
  }
830
828