-
Notifications
You must be signed in to change notification settings - Fork 522
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
- Added ESLint integration to the Vite checker for improved code quality. - Updated the browser support generation script to include an ESLint disable comment in the output file. - Added an ESLint disable comment in the plugin map generation for better linting control. These changes aim to streamline development and maintain code standards.
- Loading branch information
1 parent
c5c52b6
commit 4634a6d
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