File tree 2 files changed +8
-6
lines changed
packages/@vue/cli-service/lib
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,11 @@ module.exports = (api, options) => {
60
60
if ( ! isProduction ) {
61
61
const devClients = [
62
62
// dev server client
63
- `webpack-dev-server/client/ ?${ urls . localUrlForBrowser } ` ,
63
+ require . resolve ( `webpack-dev-server/client` ) + ` ?${ urls . localUrlForBrowser } `,
64
64
// hmr client
65
- projectDevServerOptions . hotOnly
65
+ require . resolve ( projectDevServerOptions . hotOnly
66
66
? 'webpack/hot/only-dev-server'
67
- : 'webpack/hot/dev-server'
67
+ : 'webpack/hot/dev-server' )
68
68
// TODO custom overlay client
69
69
// `@vue/cli-overlay/dist/client`
70
70
]
Original file line number Diff line number Diff line change 1
1
module . exports = ( api , options ) => {
2
2
api . chainWebpack ( webpackConfig => {
3
+ const fs = require ( 'fs' )
3
4
const resolveLocal = require ( '../util/resolveLocal' )
4
5
const resolveClientEnv = require ( '../util/resolveClientEnv' )
5
6
@@ -98,11 +99,12 @@ module.exports = (api, options) => {
98
99
child_process : 'empty'
99
100
} )
100
101
102
+ const htmlPath = api . resolve ( 'public/index.html' )
101
103
webpackConfig
102
104
. plugin ( 'html' )
103
- . use ( require ( 'html-webpack-plugin' ) , [ {
104
- template : api . resolve ( 'public/index.html' )
105
- } ] )
105
+ . use ( require ( 'html-webpack-plugin' ) , [
106
+ fs . existsSync ( htmlPath ) ? { template : htmlPath } : { }
107
+ ] )
106
108
107
109
// inject preload/prefetch to HTML
108
110
const PreloadPlugin = require ( '../webpack/PreloadPlugin' )
You can’t perform that action at this time.
0 commit comments