vue-macros: Webpack / Vue CLI: `defineOptions is not defined` (production mode)
dependencies: “vue”: “^3.2.13”, “unplugin-vue-define-options”: “^0.6.1”, ”webpack": “5.70.0”
vue.config.js
config:
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 32 (11 by maintainers)
Commits related to this issue
- fix: support webpack with vue-loader@15 relate issue https://github.com/sxzz/unplugin-vue-macros/issues/23#issuecomment-1285433093 — committed to vue-macros/vue-macros by sxzz 2 years ago
- fix: support webpack with vue-loader@15 relate issue https://github.com/sxzz/unplugin-vue-macros/issues/23#issuecomment-1285433093 — committed to vue-macros/vue-macros by sxzz 2 years ago
- fix: support webpack with vue-loader@15 relate issue https://github.com/sxzz/unplugin-vue-macros/issues/23#issuecomment-1285433093 — committed to topsmart20/vue-macros by topsmart20 2 years ago
You can set
parallel: false
in vue.config.js to disable thread-loader.Related: https://github.com/vuejs/vue-cli/issues/2785#issuecomment-432106435 https://github.com/webpack-contrib/thread-loader/issues/27
You can use
parallelize-webpack-unplugin
if you have tried this method and it works. It partially simplifies the parameters that unplugin depends on to allow the plugin to support running withthread-loader
, so that you can enjoy the benefits of concurrent compilation at the same time.@qinyang912 Thanks for your feedback! For Vue 2 (Vue loader 15) + Webpack, an additional option is required.
I will add it to the documentation later.
@Nstd 有用!
@ShaneLee-9 需要再加个一个配置: https://github.com/sxzz/unplugin-vue-macros/issues/23#issuecomment-1170283222
@qq619433305
vue 3 webpack 5 非 TS 使用这个可以:https://github.com/sxzz/unplugin-vue-macros/issues/23#issuecomment-1285433093
This is the project repo: https://github.com/ShaneLee-9/vue-define-options-demo This is the production: https://shanelee-9.github.io/vue-define-options-demo/