Skip to content

Commit 2b33f59

Browse files
committed
fix: Disable __VUE_PROD_DEVTOOLS__ for production build
- VueI18n raises ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined in production build - Add missing ElementPlus import in main as we now use it as devDependency
1 parent 70e2fe1 commit 2b33f59

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

build/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ module.exports = (env, argv) => {
146146
// It can be used in the code directly.
147147
CONFIG_LOCAL: JSON.stringify(configLocal)
148148
}),
149+
new webpack.DefinePlugin({
150+
__VUE_PROD_DEVTOOLS__: JSON.stringify(!isDev)
151+
}),
149152
new webpack.IgnorePlugin({
150153
resourceRegExp: /^fs$/
151154
}),

src/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import ElementPlus from 'element-plus';
12
import { createApp } from 'vue';
23
import { createI18n } from 'vue-i18n';
34
import messages from './common/i18n';
5+
import { store } from './common/store';
46
import EditorPage from './editor/Editor.vue';
5-
import ExplorePage from './explore/Explore.vue';
67
import ViewPage from './editor/View.vue';
7-
import { store } from './common/store';
8+
import ExplorePage from './explore/Explore.vue';
89

910
/**
1011
*

0 commit comments

Comments
 (0)