mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-06 10:06:36 +08:00
x修复反代
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build && node toFile.mjs",
|
"build": "tsc && vite build",
|
||||||
"lint": "eslint --fix",
|
"lint": "eslint --fix",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
@@ -69,7 +69,6 @@
|
|||||||
"@types/react-dom": "18.3.0",
|
"@types/react-dom": "18.3.0",
|
||||||
"@typescript-eslint/eslint-plugin": "8.31.1",
|
"@typescript-eslint/eslint-plugin": "8.31.1",
|
||||||
"@typescript-eslint/parser": "8.31.1",
|
"@typescript-eslint/parser": "8.31.1",
|
||||||
"@vitejs/plugin-legacy": "^5.4.3",
|
|
||||||
"@vitejs/plugin-react": "4.4.1",
|
"@vitejs/plugin-react": "4.4.1",
|
||||||
"eslint": "9.25.1",
|
"eslint": "9.25.1",
|
||||||
"eslint-config-prettier": "9.1.0",
|
"eslint-config-prettier": "9.1.0",
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
console.time('转换耗时');
|
|
||||||
const distPath = './dist/index.html';
|
|
||||||
let htmlText = fs.readFileSync(distPath, 'utf8');
|
|
||||||
let resultText = '';
|
|
||||||
let htmlArr = htmlText.match(/.*\n/g) || [];
|
|
||||||
htmlArr.forEach(str => {
|
|
||||||
str = str.replace(/\s?nomodule\s?/g,' ');
|
|
||||||
str = str.replace(/\s?crossorigin\s?/g,' ');
|
|
||||||
str = str.replace(/data-src/g,'src');
|
|
||||||
if(!/type="module"/i.test(str)) resultText += str;
|
|
||||||
});
|
|
||||||
fs.writeFileSync(distPath,resultText,'utf8');
|
|
||||||
console.timeEnd('转换耗时');
|
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import legacy from '@vitejs/plugin-legacy'
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
legacy()
|
|
||||||
],
|
],
|
||||||
base: './',
|
base: './',
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in New Issue
Block a user