Skip to content
This repository was archived by the owner on Jul 4, 2021. It is now read-only.

Commit 85e093f

Browse files
authored
fix: suppress console in production (#80)
1 parent fd7e04a commit 85e093f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function pluginI18n(
4141
}
4242
}
4343

44-
const env = process.env.NODE_ENV || 'development'
4544
const filter = createFilter(include)
4645
const runtimeOnly = isBoolean(options.runtimeOnly)
4746
? options.runtimeOnly
@@ -57,8 +56,8 @@ function pluginI18n(
5756
return {
5857
name: 'vite-plugin-vue-i18n',
5958

60-
config(config: UserConfig) {
61-
if (env === 'production' && runtimeOnly) {
59+
config(config: UserConfig, { command }) {
60+
if (command === 'build' && runtimeOnly) {
6261
normalizeConfigResolveAliias(config)
6362
if (isArray(config.resolve!.alias)) {
6463
config.resolve!.alias.push({

0 commit comments

Comments
 (0)