lisonge / vite-plugin-monkey

A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat
MIT License
1.41k stars 72 forks source link

dev环境正常运行,打包后报错 #172

Closed javaisbestlang closed 4 months ago

javaisbestlang commented 4 months ago

错误信息

image

看起来是Vue没有导入 ?

我的配置

 monkey({
      entry: 'src/main.js',
      // ... 
      build: {
        externalGlobals: {
          "vue": cdn.unpkg('Vue', 'dist/vue.global.prod.js'),
          'element-plus': cdn.unpkg('ElementPlus', 'dist/index.full.min.js'),
        },
        externalResource: {
          "element-plus/dist/index.css": cdn.unpkg('elementPlusCss', "dist/index.css")
        },
        // ...
      },
    }),

打包后资源信息

// @require      https://unpkg.com/vue@3.3.4/dist/vue.global.prod.js
// @require      https://unpkg.com/element-plus@2.3.14/dist/index.full.min.js
// @resource     elementPlusCss  https://unpkg.com/element-plus@2.3.14/dist/index.css

访问 链接均没有问题

lisonge commented 4 months ago

170

javaisbestlang commented 4 months ago

170

感谢