-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance Vite configuration and browser support script (#10040)
- Loading branch information
1 parent
c5c52b6
commit b24e645
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import { getUserAgentRegex } from 'browserslist-useragent-regexp'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import { getUserAgentRegex } from "browserslist-useragent-regexp"; | ||
import fs from "fs"; | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
const regex = getUserAgentRegex({ | ||
ignoreMinor: true, | ||
ignorePatch: true, | ||
allowZeroSubversions: false, | ||
allowHigherVersions: true, | ||
ignoreMinor: true, | ||
ignorePatch: true, | ||
allowZeroSubversions: false, | ||
allowHigherVersions: true, | ||
}); | ||
|
||
const supportedBrowsersPath = path.resolve(__dirname, '../src/supportedBrowsers.ts'); | ||
fs.writeFileSync(supportedBrowsersPath, `export default ${regex};`); | ||
const supportedBrowsersPath = path.resolve( | ||
__dirname, | ||
"../src/supportedBrowsers.ts", | ||
); | ||
fs.writeFileSync( | ||
supportedBrowsersPath, | ||
`/* eslint-disable */ | ||
export default ${regex}; | ||
`, | ||
); |
This file contains 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
This file contains 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