File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ describe('electron:build', () => {
203
203
fs . existsSync . mockReturnValueOnce ( true )
204
204
await runCommand ( 'electron:build' )
205
205
// css/fonts folder was created
206
- expect ( fs . ensureDirSync . mock . calls [ 1 ] [ 0 ] ) . toBe (
206
+ expect ( fs . ensureDirSync . mock . calls [ 2 ] [ 0 ] ) . toBe (
207
207
'projectPath/dist_electron/bundled/css/fonts'
208
208
)
209
209
// fonts was copied to css/fonts
Original file line number Diff line number Diff line change @@ -94,16 +94,27 @@ module.exports = (api, options) => {
94
94
// Build with electron-builder
95
95
buildApp ( )
96
96
} else {
97
+ const bundleOutputDir = path . join ( outputDir , 'bundled' )
97
98
// Arguments to be passed to renderer build
98
99
const vueArgs = {
99
100
_ : [ ] ,
100
101
// For the cli-ui webpack dashboard
101
102
dashboard : args . dashboard ,
102
103
// Make sure files are outputted to proper directory
103
- dest : outputDir + '/bundled' ,
104
+ dest : bundleOutputDir ,
104
105
// Enable modern mode unless --legacy is passed
105
106
modern : ! args . legacy
106
107
}
108
+ // With @vue /cli-service v3.4.1+, we can bypass legacy build
109
+ process . env . VUE_CLI_MODERN_BUILD = ! args . legacy
110
+ // If the legacy builded is skipped the output dir won't be cleaned
111
+ fs . removeSync ( bundleOutputDir )
112
+ fs . ensureDirSync ( bundleOutputDir )
113
+ // Mock data from legacy build
114
+ fs . writeFileSync (
115
+ path . join ( bundleOutputDir , 'legacy-assets-index.html.json' ) ,
116
+ '[]'
117
+ )
107
118
// Set the base url so that the app protocol is used
108
119
options . baseUrl = pluginOptions . customFileProtocol || 'app://./'
109
120
// Set publicPath as well (replaced baseUrl since @vue/cli 3.3.0)
You can’t perform that action at this time.
0 commit comments