File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,24 @@ function copyVuePlugin(): Plugin {
21
21
return {
22
22
name : 'copy-vue' ,
23
23
generateBundle ( ) {
24
- const filePath = path . resolve (
25
- __dirname ,
26
- '../vue/dist/vue.runtime.esm-browser.js'
27
- )
28
- if ( ! fs . existsSync ( filePath ) ) {
29
- throw new Error (
30
- `vue.runtime.esm-browser.js not built. ` +
31
- `Run "nr build vue -f esm-browser" first.`
32
- )
24
+ const copyFile = ( file : string ) => {
25
+ const filePath = path . resolve ( __dirname , file )
26
+ const basename = path . basename ( file )
27
+ if ( ! fs . existsSync ( filePath ) ) {
28
+ throw new Error (
29
+ `${ basename } not built. ` +
30
+ `Run "nr build vue -f esm-browser" first.`
31
+ )
32
+ }
33
+ this . emitFile ( {
34
+ type : 'asset' ,
35
+ fileName : basename ,
36
+ source : fs . readFileSync ( filePath , 'utf-8' )
37
+ } )
33
38
}
34
- this . emitFile ( {
35
- type : 'asset' ,
36
- fileName : 'vue.runtime.esm-browser.js' ,
37
- source : fs . readFileSync ( filePath , 'utf-8' )
38
- } )
39
+
40
+ copyFile ( `../vue/dist/vue.runtime.esm-browser.js` )
41
+ copyFile ( `../server-renderer/dist/server-renderer.esm-browser.js` )
39
42
}
40
43
}
41
44
}
You can’t perform that action at this time.
0 commit comments