代码拉取完成,页面将自动刷新
同步操作将从 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';
// import mkcert from 'vite-plugin-mkcert';
// import { visualizer } from 'rollup-plugin-visualizer';
//@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',
// },
],
}),
],
define: {
'process.env': process.env,
},
// 入口
publicDir: '/sdk',
build: {
emptyOutDir: false,
outDir: 'dist-sdk', // 指定输出目录
lib: {
//@ts-ignore
entry: path.resolve(__dirname, 'src/pages/editor/core/coresdk.tsx'),
name: 'CoreSDK', // 暴露的全局变量
fileName: format => `coresdk.${format}.js`,
},
rollupOptions: {
output: {
assetFileNames: 'coresdk.[name].[ext]',
},
},
},
base: '/', // 公共基础路径
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。