| |
| |
| |
| |
| @@ -73,7 +73,6 @@ |
| }, |
| "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", |
| "dependencies": { |
| - "@oxc-project/runtime": "0.120.0", |
| "lightningcss": "^1.32.0", |
| "picomatch": "^4.0.3", |
| "postcss": "^8.5.8", |
| |
| |
| |
| |
| @@ -4,6 +4,7 @@ import { |
| viteAliasPlugin as nativeAliasPlugin, |
| viteJsonPlugin as nativeJsonPlugin, |
| viteWasmFallbackPlugin as nativeWasmFallbackPlugin, |
| + oxcRuntimePlugin, |
| } from 'rolldown/experimental' |
| import type { PluginHookUtils, ResolvedConfig } from '../config' |
| import { |
| @@ -94,6 +95,8 @@ export async function resolvePlugins( |
| htmlInlineProxyPlugin(config), |
| cssPlugin(config), |
| esbuildBannerFooterCompatPlugin(config), |
| + // @oxc-project/runtime resolution is handled by rolldown in build |
| + config.oxc !== false && !isBundled ? oxcRuntimePlugin() : null, |
| config.oxc !== false ? oxcPlugin(config) : null, |
| nativeJsonPlugin({ ...config.json, minify: isBuild }), |
| wasmHelperPlugin(), |
| |
| |
| |
| |
| @@ -7,7 +7,6 @@ import { transformSync } from 'rolldown/utils' |
| import { viteTransformPlugin as nativeTransformPlugin } from 'rolldown/experimental' |
| import type { RolldownError, RolldownLog, SourceMap } from 'rolldown' |
| import colors from 'picocolors' |
| -import { prefixRegex } from 'rolldown/filter' |
| import type { FSWatcher } from '#dep-types/chokidar' |
| import { createFilter, ensureWatchedFile, normalizePath } from '../utils' |
| import type { ResolvedConfig } from '../config' |
| @@ -15,7 +14,7 @@ import type { Plugin } from '../plugin' |
| import { cleanUrl } from '../../shared/utils' |
| import { type Environment, perEnvironmentPlugin } from '..' |
| import type { ViteDevServer } from '../server' |
| -import { JS_TYPES_RE, VITE_PACKAGE_DIR } from '../constants' |
| +import { JS_TYPES_RE } from '../constants' |
| import type { Logger } from '../logger' |
| import { type ESBuildOptions, getTSConfigResolutionCache } from './esbuild' |
| |
| @@ -299,9 +298,6 @@ export function oxcPlugin(config: ResolvedConfig): Plugin { |
| |
| return result |
| } |
| - const runtimeResolveBase = normalizePath( |
| - path.join(VITE_PACKAGE_DIR, 'package.json'), |
| - ) |
| |
| let server: ViteDevServer |
| |
| @@ -310,23 +306,6 @@ export function oxcPlugin(config: ResolvedConfig): Plugin { |
| configureServer(_server) { |
| server = _server |
| }, |
| - // @oxc-project/runtime resolution is handled by rolldown in build |
| - ...(config.command === 'serve' |
| - ? { |
| - resolveId: { |
| - filter: { |
| - id: prefixRegex('@oxc-project/runtime/'), |
| - }, |
| - async handler(id, _importer, opts) { |
| - // @oxc-project/runtime imports will be injected by Oxc transform |
| - // since it's injected by the transform, @oxc-project/runtime should be resolved to the one Vite depends on |
| - const resolved = await this.resolve(id, runtimeResolveBase, opts) |
| - return resolved |
| - }, |
| - order: 'pre', |
| - }, |
| - } |
| - : {}), |
| async transform(code, id) { |
| if (filter(id) || filter(cleanUrl(id)) || jsxRefreshFilter?.(id)) { |
| const modifiedOxcTransformOptions = getModifiedOxcTransformOptions( |
| |
| |
| |
| |
| @@ -237,9 +237,6 @@ importers: |
| |
| packages/vite: |
| dependencies: |
| - '@oxc-project/runtime': |
| - specifier: 0.120.0 |
| - version: 0.120.0 |
| lightningcss: |
| specifier: ^1.32.0 |
| version: 1.32.0 |
| @@ -3092,10 +3089,6 @@ packages: |
| cpu: [x64] |
| os: [win32] |
| |
| - '@oxc-project/runtime@0.120.0': |
| - resolution: {integrity: sha512-7fvACzS46TkHuzA+Tag8ac40qfwURXRTdc4AtyItF59AoNPOO/QjPMqPyvJH8CaUdGu0ntWDX1CCUNyLMxxX5g==} |
| - engines: {node: ^20.19.0 || >=22.12.0} |
| - |
| '@oxc-project/types@0.120.0': |
| resolution: {integrity: sha512-k1YNu55DuvAip/MGE1FTsIuU3FUCn6v/ujG9V7Nq5Df/kX2CWb13hhwD0lmJGMGqE+bE1MXvv9SZVnMzEXlWcg==} |
| |
| @@ -9222,8 +9215,6 @@ snapshots: |
| '@oxc-minify/binding-win32-x64-msvc@0.120.0': |
| optional: true |
| |
| - '@oxc-project/runtime@0.120.0': {} |
| - |
| '@oxc-project/types@0.120.0': {} |
| |
| '@package-json/types@0.0.12': {} |
|
|