Skip to content

Commit 69471b0

Browse files
committed
fix: Disable DEVTOOLS in production build to avoid VueI18n NOT_INSTALLED error
- Add missing ElementPlus import in main as we now use it as devDependency
1 parent 70e2fe1 commit 69471b0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

build/webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ 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+
// VueI18n fails with NOT_INSTALLED error for prod build.
151+
// REVIEW: A VueI18n issue?
152+
__VUE_PROD_DEVTOOLS__: JSON.stringify(!isDev),
153+
__INTLIFY_PROD_DEVTOOLS__: JSON.stringify(!isDev)
154+
}),
149155
new webpack.IgnorePlugin({
150156
resourceRegExp: /^fs$/
151157
}),

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)