Skip to content

Commit 4f9fd84

Browse files
committed
detect production mode by checking webpack mode
1 parent ee26c3a commit 4f9fd84

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: src/index.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export interface VueLoaderOptions {
2121
compiler?: TemplateCompiler
2222
compilerOptions?: CompilerOptions
2323
hotReload?: boolean
24-
productionMode?: boolean
2524
cacheDirectory?: string
2625
cacheIdentifier?: string
2726
exposeFilename?: boolean
@@ -52,8 +51,8 @@ const loader: webpack.loader.Loader = function(source) {
5251
loaderUtils.stringifyRequest(loaderContext, r)
5352

5453
const {
54+
mode,
5555
target,
56-
minimize,
5756
sourceMap,
5857
rootContext,
5958
resourcePath,
@@ -67,8 +66,7 @@ const loader: webpack.loader.Loader = function(source) {
6766
{}) as VueLoaderOptions
6867

6968
const isServer = target === 'node'
70-
const isProduction =
71-
options.productionMode || minimize || process.env.NODE_ENV === 'production'
69+
const isProduction = mode === 'production'
7270

7371
const descriptor = parse(String(source), {
7472
filename: resourcePath,

0 commit comments

Comments
 (0)