Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: overwrite plugin-vue define with user define option #6072

Merged
merged 4 commits into from
Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/plugin-vue-jsx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ function vueJsxPlugin(options = {}) {
include: /\.ts$/
},
define: {
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
...config.define
__VUE_OPTIONS_API__: true || config.define?.__VUE_OPTIONS_API__,
__VUE_PROD_DEVTOOLS__: false || config.define?.__VUE_PROD_DEVTOOLS__
ydcjeff marked this conversation as resolved.
Show resolved Hide resolved
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
config(config) {
return {
define: {
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false
__VUE_OPTIONS_API__: true || config.define?.__VUE_OPTIONS_API__,
__VUE_PROD_DEVTOOLS__: false || config.define?.__VUE_PROD_DEVTOOLS__
},
ssr: {
external: ['vue', '@vue/server-renderer']
Expand Down