-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
350 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module.exports = (api, args, options) => { | ||
const config = api.resolveChainableWebpackConfig() | ||
const targetDir = api.resolve(args.dest || options.outputDir) | ||
|
||
// respect inline build destination in copy plugin | ||
if (args.dest && config.plugins.has('copy')) { | ||
config.plugin('copy').tap(args => { | ||
args[0][0].to = targetDir | ||
return args | ||
}) | ||
} | ||
|
||
if (options.modernMode) { | ||
const ModernModePlugin = require('../../webpack/ModernModePlugin') | ||
const isModernBuild = !!process.env.VUE_CLI_MODERN_BUILD | ||
if (!isModernBuild) { | ||
// Inject plugin to extract build stats and write to disk | ||
config | ||
.plugin('modern-mode-legacy') | ||
.use(ModernModePlugin, [targetDir, false]) | ||
} else { | ||
// Inject plugin to read non-modern build stats and inject HTML | ||
config | ||
.plugin('modern-mode-modern') | ||
.use(ModernModePlugin, [targetDir, true]) | ||
} | ||
} | ||
|
||
const rawConfig = config.toConfig() | ||
|
||
// respect inline entry | ||
if (args.entry && !options.pages) { | ||
rawConfig.entry = { app: api.resolve(args.entry) } | ||
} | ||
|
||
return rawConfig | ||
} |
Oops, something went wrong.