File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,19 @@ import { watch } from 'chokidar';
5
5
import fs from 'fs-extra' ;
6
6
7
7
import { writeManifest } from './manifest' ;
8
- import { isDev , port , resolveParent } from './utils' ;
8
+ import { isDev , resolveParent } from './utils' ;
9
9
10
10
/**
11
11
* Replace index.html with link to vite localhost for hot reload
12
12
* @param view the view to replace
13
13
*/
14
14
const copyIndexHtml = async ( view : string ) => {
15
15
fs . ensureDirSync ( resolveParent ( `dist/views/${ view } ` ) ) ;
16
- const data = fs
17
- . readFileSync ( resolveParent ( `src/views/${ view } /index.html` ) , 'utf-8' )
18
- . replace ( '"./main.ts"' , `"http://localhost:${ port } /views/${ view } /main.ts"` )
19
- . replace ( '<div id="app"></div>' , '<div id="app">Vite server did not start</div>' ) ;
16
+ const data = fs . readFileSync ( resolveParent ( `src/views/${ view } /index.html` ) , 'utf-8' ) . replace (
17
+ '<script type="module" src="./main.ts"></script>' ,
18
+ `<script type="module" src="http://localhost:3303/@vite/client"></script>
19
+ <script type="module" src="http://localhost:3303/views/popup/main.ts"></script>` ,
20
+ ) ;
20
21
fs . writeFileSync ( resolveParent ( `dist/views/${ view } /index.html` ) , data , 'utf-8' ) ;
21
22
console . log ( `Stubbing '${ view } ' to '${ __dirname } /dist/views/${ view } /index.html'` ) ;
22
23
} ;
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ const show = ref(false);
6
6
7
7
<template >
8
8
<div class =" about" >
9
- <h1 >This is an about page</h1 >
9
+ <h1 >This is an about page ! </h1 >
10
10
</div >
11
11
</template >
12
12
13
13
<style scoped>
14
14
.about {
15
15
display : flex ;
16
16
justify-content : center ;
17
- color : red ;
17
+ color : green ;
18
18
}
19
19
</style >
You can’t perform that action at this time.
0 commit comments