feat(vite,webpack): tree-shakable import.meta.* build flags#22428
Merged
feat(vite,webpack): tree-shakable import.meta.* build flags#22428
import.meta.* build flags#22428Conversation
Co-authored-by: Lucas Vargas <vargasmesh@users.noreply.github.com>
Co-authored-by: Lucas Vargas <vargasmesh@users.noreply.github.com>
|
|
Contributor
✅ Live Preview ready!
|
import.meta build flags
import.meta build flagsCheck notice
Code scanning / CodeQL
Syntax error
| .then(r => r.default(process.server ? url : window.location.href))) | ||
| const url = import.meta.server ? nuxtApp.ssrContext.url : window.location.pathname | ||
| const SingleRenderer = import.meta.test && import.meta.dev && import.meta.server && url.startsWith('/__nuxt_component_test__/') && /* #__PURE__ */ defineAsyncComponent(() => import('#build/test-component-wrapper.mjs') | ||
| .then(r => r.default(import.meta.server ? url : window.location.href))) |
Check warning
Code scanning / CodeQL
Client-side cross-site scripting (experimental)
danielroe
approved these changes
Aug 7, 2023
import.meta.* build flags
Merged
6 tasks
This was referenced Mar 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves #21862
❓ Type of change
📚 Description
Introduce:
import.meta.browserand replaceprocess.browserimport.meta.clientand replaceprocess.clientimport.meta.serverand replaceprocess.serverimport.meta.devand replaceprocess.devimport.meta.testand replaceprocess.testRemove unused flags:
Define
NuxtStaticBuildFlags:Note that this also bumps the webpack server target to
es2020to be in line with vite's default target, and also to supportimport.meta.urlon the server.📝 Checklist