代码拉取完成,页面将自动刷新
同步操作将从 mantou/image-editor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import { defineConfig } from "vite";
//@ts-ignore
import path from "path";
import react from "@vitejs/plugin-react";
import vitePluginImp from "vite-plugin-imp";
//@ts-ignore
const resolve = (url) => path.resolve(__dirname, url);
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@components': resolve('./src/components'),
'@server': resolve('./src/server'),
'@core': resolve('./src/pages/editor/core'),
'@options': resolve('./src/pages/editor/components/options/components'),
'@plugins': resolve('./src/pages/editor/plugins'),
'@pages': resolve('./src/pages'),
'@language': resolve('./src/language'),
'@hooks': resolve('./src/hooks'),
'@theme': resolve('./src/theme'),
'@layout': resolve('./src/layout'),
'@stores': resolve('./src/stores'),
'@utils': resolve('./src/utils'),
'@config': resolve('./src/config'),
'@less': resolve('./src/less'),
'@images': resolve('./src/assets/images'),
},
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json"], // 省略扩展名
},
plugins: [
react({
babel: {
plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }],
["@babel/plugin-proposal-class-properties", { loose: true }],
],
},
}),
vitePluginImp({
libList: [
{
libName: "@icon-park/react",
libDirectory: "es/icons",
camel2DashComponentName: false,
},
{
libName: "lodash",
libDirectory: "",
camel2DashComponentName: false,
},
// {
// libName: '@douyinfe/semi-ui',
// },
],
}),
],
css: {
modules: {
generateScopedName: "[name]__[local]__[hash:5]",
},
preprocessorOptions: {
less: {
// 支持内联 javascript
javascriptEnabled: true,
},
},
},
// 入口
build: {
rollupOptions: {
output: {
chunkFileNames: "editorAssets/js/[name]-[hash].js",
entryFileNames: "editorAssets/js/[name]-[hash].js",
assetFileNames: "editorAssets/[ext]/[name]-[hash].[ext]",
},
input: {
main: resolve("index.html"),
},
},
minify: "terser",
terserOptions: {
compress: {
//生产环境时移除console
drop_console: true,
drop_debugger: true,
},
},
},
base: "/", // 公共基础路径
server: {
host: "0.0.0.0",
port: 3004,
proxy: {
'/cgi-bin': {
target: 'https://image.h5ds.com',
changeOrigin: true,
},
'/api': {
target: 'https://image.h5ds.com',
changeOrigin: true,
},
'/fonts': {
target: 'https://cdn.h5ds.com/assets',
changeOrigin: true,
},
},
},
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。