Code Monkey home page Code Monkey logo

Comments (6)

CDCDA avatar CDCDA commented on June 20, 2024 1

from md-editor-v3.

imzbf avatar imzbf commented on June 20, 2024

方便的话,提供一下还原问题的可运行代码,和你的部署方式

from md-editor-v3.

CDCDA avatar CDCDA commented on June 20, 2024

from md-editor-v3.

imzbf avatar imzbf commented on June 20, 2024

只要引入就会报错 /*  * @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.

imzbf avatar imzbf commented on June 20, 2024

vite-plugin-require-transform这个是吗

from md-editor-v3.

CDCDA avatar CDCDA commented on June 20, 2024

from md-editor-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.