Skip to content

Commit

Permalink
fix(legacy): fix browserslist import, close vitejs#11898 (vitejs#11899)
Browse files Browse the repository at this point in the history
ModyQyW authored and futurGH committed Feb 26, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
renovate-bot Mend Renovate
1 parent 3f83801 commit a14faa4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugin-legacy/src/index.ts
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ import type {
types as BabelTypes,
} from '@babel/core'
import colors from 'picocolors'
import { loadConfig as browserslistLoadConfig } from 'browserslist'
import browserslist from 'browserslist'
import type { Options } from './types'
import {
detectModernBrowserCode,
@@ -45,6 +45,10 @@ async function loadBabel() {
return babel
}

// The requested module 'browserslist' is a CommonJS module
// which may not support all module.exports as named exports
const { loadConfig: browserslistLoadConfig } = browserslist

// Duplicated from build.ts in Vite Core, at least while the feature is experimental
// We should later expose this helper for other plugins to use
function toOutputFilePathInHtml(

0 comments on commit a14faa4

Please sign in to comment.