Comments (6)
from md-editor-v3.
方便的话,提供一下还原问题的可运行代码,和你的部署方式
from md-editor-v3.
from md-editor-v3.
只要引入就会报错 /* * @description:打包配置 * @author: cyd @.*** * @Date: 2023-06-26 16:41:56 * @LastEditTime: 2023-11-28 14:10:40 / import { defineConfig } from 'vite'; import vue from @./plugin-vue'; import commonjs from @./plugin-commonjs'; import requireTransform from 'vite-plugin-require-transform'; import path from 'path'; import viteCompression from 'vite-plugin-compression'; import legacy from @./plugin-legacy'; import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; // https://vitejs.dev/config/ export default defineConfig({ // root: resolve('./'), // 入口index.html,注意入口js应该与index.html 同一目录下(只能写到目录,不能写到具体文件) base: './', // publicDir: resolve('static'), //静态资源文件夹 plugins: [ commonjs() as any, legacy({ targets: ['defaults', 'not IE 11'] }), vue(), createSvgIconsPlugin({ iconDirs: [path.resolve(process.cwd(), 'src/assets/svg')], symbolId: '[name]' }), requireTransform({ fileRegex: /.js$|.vue$|.png$|.ts$|.jpg$/ }), //配置require viteCompression({ verbose: true, disable: false, threshold: 10240, algorithm: 'gzip', ext: '.gz' }) ], css: { preprocessorOptions: { scss: { additionalData: @.* "./src/assets/theme/theme.scss";' // 加载全局样式,使用scss特性 } } }, resolve: { alias: { // 这里就是需要配置resolve里的别名 '@': path.join(__dirname, './src') // path记得引入 // 'vue': 'vue/dist/vue.esm-bundler.js' // 定义vue的别名,如果使用其他的插件,可能会用到别名 } }, optimizeDeps: { include: ['@/../lib/vform/designer.umd.js'] //此处路径必须跟main.js中import路径完全一致! }, build: { commonjsOptions: { include: /node_modules|lib/ //这里记得把lib目录加进来,否则生产打包会报错!! }, outDir: 'JcCloudWeb', cssCodeSplit: true, rollupOptions: { input: 'index.html', output: { // 静态资源打包做处理 chunkFileNames: 'static/js/[name]-[hash].js', entryFileNames: 'static/js/[name]-[hash].js', assetFileNames: 'static/[ext]/[name]-[hash].[ext]', manualChunks(id) { if (id.includes('node_modules')) { return id.toString().split('node_modules/')[1].split('/')[0].toString(); } } } }, minify: 'terser', terserOptions: { // 清除console和debugger compress: { drop_console: true, drop_debugger: true } } }, server: { port: 8086, host: '0.0.0.0', headers: { 'Access-Control-Allow-Origin': '' }, proxy: { '/dev-api': { target: 'http://localhost:5008', changeOrigin: true, rewrite: p => p.replace(/^/dev-api/, '') } } } }); 打包后部署到服务器使用nginx代理 我打算先用cdn方式,感谢帮忙 陈毅东 @.**
…
------------------ 原始邮件 ------------------ 发件人: "imzbf/md-editor-v3" @.>; 发送时间: 2024年2月1日(星期四) 凌晨0:34 @.>; @.@.>; 主题: Re: [imzbf/md-editor-v3] vite打包部署后引用编辑器出现 st.join is not a function (Issue #447) 方便的话,提供一下还原问题的可运行代码,和你的部署方式 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
👌,问题还原不了,这多半和你构建项目的环境有关系
from md-editor-v3.
vite-plugin-require-transform
这个是吗
from md-editor-v3.
from md-editor-v3.
Related Issues (20)
- 预览模式点击目录跳转后给一个距离顶部的参数 HOT 2
- 公式为啥渲染不出来函数,例如sqrt等 HOT 5
- transformImgUrl 属性没效果 HOT 3
- 在组件中展示视频 HOT 1
- 新的4.16.0 代码显示这块更新后,和屏幕截图 "html-to-image": "^1.11.11", 冲突了 HOT 2
- 更新新版后,图片下方不再显示标题了 HOT 1
- 禁用代码折叠之后不应该显示那个小图标 HOT 2
- Cannot read properties of null (reading 'offsetTop') HOT 1
- 如何将mermaid CDN引入改为本地引入? HOT 1
- 关于内存溢出的咨询 HOT 5
- 代码块未知原因不显示 HOT 1
- 预览组件不显示有序列表 HOT 3
- 关于全部关闭CDN的问题 HOT 7
- Cannot use domEventHandlers HOT 6
- 仅预览模式,’\n‘换行后空了一行出来 HOT 9
- 编辑器工具栏消失 HOT 11
- 工具栏水平滑动失效 HOT 1
- 预览模式下能不能添加个变量识别? HOT 2
- 为什么类似于a.is,这样的字符串会被渲染成<a>标签呀?如图 HOT 5
- mermaid instance设置问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from md-editor-v3.