移除 babel

This commit is contained in:
lyswhut
2026-04-10 09:10:58 +08:00
parent cc192cab44
commit e35895d752
14 changed files with 24 additions and 1965 deletions

View File

@@ -1,26 +0,0 @@
{
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
"corejs": "3",
"useBuiltIns": "usage"
}
]
// [
// "minify",
// {
// "builtIns": false,
// "evaluate": false,
// "mangle": false
// }
// ]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-modules-umd",
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-class-properties"
]
}

View File

@@ -55,7 +55,6 @@ const vueRule = {
exports.base = { exports.base = {
extends: ['standard'], extends: ['standard'],
rules: baseRule, rules: baseRule,
parser: '@babel/eslint-parser',
} }
exports.html = { exports.html = {

View File

@@ -19,15 +19,6 @@ module.exports = merge(baseConfig, {
externals: [ externals: [
// ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)), // ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
], ],
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {

View File

@@ -18,15 +18,6 @@ module.exports = merge(baseConfig, {
externals: [ externals: [
// ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)), // ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
], ],
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {

View File

@@ -39,15 +39,6 @@ module.exports = merge(baseConfig, {
externals: [ externals: [
// ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)), // ...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d)),
], ],
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
plugins: [ plugins: [
new CopyWebpackPlugin({ new CopyWebpackPlugin({
patterns: [ patterns: [

View File

@@ -1,12 +1,12 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": "./", "rootDir": "./",
"paths": { "paths": {
"@main/*": ["src/main/*"], "@main/*": ["./src/main/*"],
"@renderer/*": ["src/renderer/*"], "@renderer/*": ["./src/renderer/*"],
"@lyric/*": ["src/renderer-lyric/*"], "@lyric/*": ["./src/renderer-lyric/*"],
"@static/*": ["src/static/*"], "@static/*": ["./src/static/*"],
"@common/*": ["src/common/*"], "@common/*": ["./src/common/*"],
} }
}, },
"vueCompilerOptions": { "vueCompilerOptions": {

1878
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -107,15 +107,6 @@
}, },
"homepage": "https://github.com/lyswhut/lx-music-desktop#readme", "homepage": "https://github.com/lyswhut/lx-music-desktop#readme",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.29.0",
"@babel/eslint-parser": "^7.28.6",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-class-properties": "^7.28.6",
"@babel/plugin-transform-modules-umd": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@babel/preset-typescript": "^7.28.5",
"@babel/runtime": "^7.29.2",
"@tsconfig/recommended": "^1.0.13", "@tsconfig/recommended": "^1.0.13",
"@types/better-sqlite3": "^7.6.13", "@types/better-sqlite3": "^7.6.13",
"@types/needle": "^3.3.0", "@types/needle": "^3.3.0",
@@ -123,7 +114,6 @@
"@types/tunnel": "^0.0.7", "@types/tunnel": "^0.0.7",
"@types/ws": "8.5.4", "@types/ws": "8.5.4",
"@vue/language-plugin-pug": "^3.2.6", "@vue/language-plugin-pug": "^3.2.6",
"babel-loader": "^10.1.1",
"browserslist": "^4.28.1", "browserslist": "^4.28.1",
"chalk": "^4.1.2", "chalk": "^4.1.2",
"changelog-parser": "^3.0.1", "changelog-parser": "^3.0.1",

View File

@@ -5,7 +5,7 @@
"./types" "./types"
], ],
"paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */ "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
"@common/*": ["common/*"], "@common/*": ["./*"],
}, },
}, },
} }

View File

@@ -5,10 +5,10 @@
"./types" "./types"
], ],
"paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */ "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
"@common/*": ["common/*"], "@common/*": ["../common/*"],
"@main/*": ["main/*"], "@main/*": ["../main/*"],
"@static/*": ["static/*"], "@static/*": ["../static/*"],
"@/*": ["./*"], "@/*": ["../*"],
}, },
}, },
} }

View File

@@ -3,11 +3,11 @@
"compilerOptions": { "compilerOptions": {
"isolatedModules": true, "isolatedModules": true,
"paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */ "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
"@common/*": ["common/*"], "@common/*": ["../common/*"],
// "@renderer/*": ["renderer/*"], // "@renderer/*": ["renderer/*"],
"@lyric/*": ["renderer-lyric/*"], "@lyric/*": ["../renderer-lyric/*"],
"@static/*": ["static/*"], "@static/*": ["../static/*"],
"@root/*": ["./*"], "@root/*": ["../*"],
}, },
"typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */ "typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */
"./types" "./types"

View File

@@ -3,11 +3,11 @@
"compilerOptions": { "compilerOptions": {
"isolatedModules": true, "isolatedModules": true,
"paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */ "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
"@common/*": ["common/*"], "@common/*": ["../common/*"],
"@renderer/*": ["renderer/*"], "@renderer/*": ["../renderer/*"],
// "@lyric/*": ["renderer-lyric/*"], // "@lyric/*": ["../renderer-lyric/*"],
"@static/*": ["static/*"], "@static/*": ["../static/*"],
"@root/*": ["./*"], "@root/*": ["../*"],
}, },
"typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */ "typeRoots": [ /* Specify multiple folders that act like './node_modules/@types'. */
"./types" "./types"

View File

@@ -1,7 +1,7 @@
import { checkPath, joinPath, extname, basename, readFile, getFileStats } from '@common/utils/nodejs' import { checkPath, joinPath, extname, basename, readFile, getFileStats } from '@common/utils/nodejs'
import { formatPlayTime } from '@common/utils/common' import { formatPlayTime } from '@common/utils/common'
import type { IComment } from 'music-metadata/lib/type'
import { decodeKrc } from '@common/utils/lyricUtils/kg' import { decodeKrc } from '@common/utils/lyricUtils/kg'
import { type IAudioMetadata } from 'music-metadata'
export const checkDownloadFileAvailable = async(musicInfo: LX.Download.ListItem, savePath: string): Promise<boolean> => { export const checkDownloadFileAvailable = async(musicInfo: LX.Download.ListItem, savePath: string): Promise<boolean> => {
return musicInfo.isComplate && !/\.ape$/.test(musicInfo.metadata.fileName) && return musicInfo.isComplate && !/\.ape$/.test(musicInfo.metadata.fileName) &&
@@ -164,6 +164,7 @@ export const getLocalMusicFilePic = async(path: string) => {
// return lyricInfo // return lyricInfo
// } // }
type IComment = NonNullable<IAudioMetadata['common']['comment']> extends Array<infer U> ? U : never
/** /**
* 获取歌曲文件歌词 * 获取歌曲文件歌词

View File

@@ -5,10 +5,10 @@
"target": "ESNext", "target": "ESNext",
"allowJs": true, "allowJs": true,
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Node", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"rootDir": "./",
"outDir": "./dist", "outDir": "./dist",
"baseUrl": "./src", /* Specify the base directory to resolve non-relative module names. */
// "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */ // "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */
// "@common/*": ["common/*"], // "@common/*": ["common/*"],
// "@renderer/*": ["renderer/*"], // "@renderer/*": ["renderer/*"],