diff --git a/.npmrc b/.npmrc index 4d97f291fd1e49..f1b91089bd4116 100644 --- a/.npmrc +++ b/.npmrc @@ -1,10 +1,6 @@ -hoist-pattern[]=*eslint* -hoist-pattern[]=*babel* -hoist-pattern[]=@emotion/* -hoist-pattern[]=postcss -hoist-pattern[]=pug -hoist-pattern[]=source-map-support -hoist-pattern[]=ts-node +hoist-pattern[]=ts-node # package/vite: postcss-load-config +hoist-pattern[]=postcss # package/vite +hoist-pattern[]=pug # playground/tailwind: @vue/compiler-sfc strict-peer-dependencies=false shell-emulator=true auto-install-peers=false diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md index d5f92bad9ad879..ebcdade803e2ea 100644 --- a/docs/guide/api-plugin.md +++ b/docs/guide/api-plugin.md @@ -159,7 +159,9 @@ The following hooks are called on each incoming module request: - [`load`](https://rollupjs.org/plugin-development/#load) - [`transform`](https://rollupjs.org/plugin-development/#transform) -They also have an extended `options` parameter with additional Vite-specific properties. You can read more in the [SSR documentation](/guide/ssr#ssr-specific-plugin-logic). +These hooks also have an extended `options` parameter with additional Vite-specific properties. You can read more in the [SSR documentation](/guide/ssr#ssr-specific-plugin-logic). + +Some `resolveId` calls' `importer` value may be an absolute path for a generic `index.html` at root as it's not always possible to derive the actual importer due to Vite's unbundled dev server pattern. For imports handled within Vite's resolve pipeline, the importer can be tracked during the import analysis phase, providing the correct `importer` value. The following hooks are called when the server is closed: diff --git a/package.json b/package.json index 50b64f5124956e..907405ddea2d4d 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@microsoft/api-extractor": "^7.34.4", "@rollup/plugin-typescript": "^11.1.0", "@types/babel__core": "^7.20.0", + "@types/babel__preset-env": "^7.9.2", "@types/babel__standalone": "^7.1.4", "@types/convert-source-map": "^2.0.0", "@types/cross-spawn": "^6.0.2", diff --git a/packages/plugin-legacy/src/index.ts b/packages/plugin-legacy/src/index.ts index 29dfb4f754a128..b9e3be2a852802 100644 --- a/packages/plugin-legacy/src/index.ts +++ b/packages/plugin-legacy/src/index.ts @@ -438,7 +438,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] { }), ], [ - '@babel/preset-env', + (await import('@babel/preset-env')).default, createBabelPresetEnvOptions(targets, { needPolyfills, ignoreBrowserslistConfig: options.ignoreBrowserslistConfig, @@ -608,7 +608,7 @@ export async function detectPolyfills( configFile: false, presets: [ [ - '@babel/preset-env', + (await import('@babel/preset-env')).default, createBabelPresetEnvOptions(targets, { ignoreBrowserslistConfig: true, }), diff --git a/packages/vite/CHANGELOG.md b/packages/vite/CHANGELOG.md index d1257f1c9695b6..fb2a6e981f3270 100644 --- a/packages/vite/CHANGELOG.md +++ b/packages/vite/CHANGELOG.md @@ -1,3 +1,14 @@ +## 4.3.5 (2023-05-05) + +* fix: location is not defined error in cleanScssBugUrl (#13100) ([91d7b67](https://github.com/vitejs/vite/commit/91d7b67)), closes [#13100](https://github.com/vitejs/vite/issues/13100) +* fix: unwrapId and pass ssr flag when adding to moduleGraph in this.load (#13083) ([9041e19](https://github.com/vitejs/vite/commit/9041e19)), closes [#13083](https://github.com/vitejs/vite/issues/13083) +* fix(assetImportMetaUrl): reserve dynamic template literal query params (#13034) ([7089528](https://github.com/vitejs/vite/commit/7089528)), closes [#13034](https://github.com/vitejs/vite/issues/13034) +* fix(debug): skip filter object args (#13098) ([d95a9af](https://github.com/vitejs/vite/commit/d95a9af)), closes [#13098](https://github.com/vitejs/vite/issues/13098) +* fix(scan): handle html script tag attributes that contain ">" (#13101) ([8a37de6](https://github.com/vitejs/vite/commit/8a37de6)), closes [#13101](https://github.com/vitejs/vite/issues/13101) +* fix(ssr): ignore __esModule for ssrExportAll (#13084) ([8a8ea1d](https://github.com/vitejs/vite/commit/8a8ea1d)), closes [#13084](https://github.com/vitejs/vite/issues/13084) + + + ## 4.3.4 (2023-05-02) * fix(define): incorrect raw expression value type in build (#13003) ([8f4cf07](https://github.com/vitejs/vite/commit/8f4cf07)), closes [#13003](https://github.com/vitejs/vite/issues/13003) diff --git a/packages/vite/package.json b/packages/vite/package.json index 3838a5530a6e2a..ae3901698547cc 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "vite", - "version": "4.3.4", + "version": "4.3.5", "type": "module", "license": "MIT", "author": "Evan You", diff --git a/packages/vite/src/node/optimizer/scan.ts b/packages/vite/src/node/optimizer/scan.ts index 5571d031245f6d..3c592cec499de5 100644 --- a/packages/vite/src/node/optimizer/scan.ts +++ b/packages/vite/src/node/optimizer/scan.ts @@ -246,9 +246,8 @@ function globEntries(pattern: string | string[], config: ResolvedConfig) { }) } -const scriptModuleRE = - /( + + + +{{ items }} diff --git a/playground/optimize-deps/index.html b/playground/optimize-deps/index.html index 8c5719075650ce..a07e6a17798154 100644 --- a/playground/optimize-deps/index.html +++ b/playground/optimize-deps/index.html @@ -165,6 +165,7 @@