File tree Expand file tree Collapse file tree 6 files changed +1586
-26
lines changed Expand file tree Collapse file tree 6 files changed +1586
-26
lines changed Original file line number Diff line number Diff line change
1
+ < div id ="app "> </ div >
2
+ < script src ="/dist/bundle.js "> </ script >
Original file line number Diff line number Diff line change
1
+ import App from './source.vue'
2
+ import { createApp } from 'vue'
3
+
4
+ createApp ( ) . mount ( App , '#app' )
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <button @click =" inc" >{{ count }}</button >
3
+ </template >
4
+
5
+ <script >
6
+ import { ref } from ' vue'
7
+
8
+ export default {
9
+ setup () {
10
+ const count = ref (0 )
11
+ return {
12
+ count,
13
+ inc : () => { count .value ++ }
14
+ }
15
+ }
16
+ }
17
+ </script >
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' )
2
+ const VueLoaderPlugin = require ( '../dist/plugin' )
3
+
4
+ module . exports = {
5
+ mode : 'development' ,
6
+ entry : path . resolve ( __dirname , './main.js' ) ,
7
+ output : {
8
+ path : path . resolve ( __dirname , 'dist' ) ,
9
+ filename : 'bundle.js' ,
10
+ publicPath : '/dist/'
11
+ } ,
12
+ devServer : {
13
+ stats : "minimal" ,
14
+ contentBase : __dirname
15
+ } ,
16
+ module : {
17
+ rules : [
18
+ {
19
+ test : / \. v u e $ / ,
20
+ loader : 'vue-loader'
21
+ }
22
+ ]
23
+ } ,
24
+ resolve : {
25
+ alias : {
26
+ 'vue' : '@vue/runtime-dom'
27
+ }
28
+ } ,
29
+ resolveLoader : {
30
+ alias : {
31
+ 'vue-loader' : require . resolve ( '../' )
32
+ }
33
+ } ,
34
+ plugins : [
35
+ new VueLoaderPlugin ( )
36
+ ]
37
+ }
Original file line number Diff line number Diff line change 9
9
" dist"
10
10
],
11
11
"scripts" : {
12
- "build" : " tsc"
12
+ "build" : " tsc" ,
13
+ "dev" : " webpack-dev-server --config example/webpack.config.js --inline --hot"
13
14
},
14
15
"peerDependencies" : {
15
16
"@vue/compiler-sfc" : " ^3.0.0-alpha.0"
23
24
"@types/loader-utils" : " ^1.1.3" ,
24
25
"@types/webpack" : " ^4.41.0" ,
25
26
"typescript" : " ^3.7.3" ,
26
- "webpack" : " ^4.41.2"
27
+ "webpack" : " ^4.41.2" ,
28
+ "webpack-cli" : " ^3.3.10" ,
29
+ "webpack-dev-server" : " ^3.9.0"
27
30
}
28
31
}
You can’t perform that action at this time.
0 commit comments