File tree Expand file tree Collapse file tree 9 files changed +4467
-0
lines changed Expand file tree Collapse file tree 9 files changed +4467
-0
lines changed Original file line number Diff line number Diff line change
1
+ dist
2
+ .DS_Store
3
+ node_modules
Original file line number Diff line number Diff line change
1
+ # vue-next-webpack-preview
2
+
3
+ > Minimal webpack setup for Vue 3 (beta)
4
+
5
+ This is for preview purposes only. There might be bugs and undocumented behavior differences from v2, which are expected.
6
+
7
+ Also note that if you are using VSCode, Vetur isn't updated to take advantage of Vue 3's typing yet so intellisense in Vue files may not be fully functional (especially in templates).
8
+
9
+ ### Prerequisites
10
+ - Node & NPM
11
+
12
+ ### Install
13
+ ``` sh
14
+ npm install
15
+ ```
16
+ ### Usage
17
+ ##### Develop
18
+ ``` sh
19
+ # run dev server at localhost:8080
20
+ npm run dev
21
+ ```
22
+ ##### Build
23
+ ``` sh
24
+ # transpile js for deployment
25
+ npm run build
26
+ ```
Original file line number Diff line number Diff line change
1
+ < link rel ="stylesheet " href ="/dist/main.css ">
2
+ < div id ="app "> </ div >
3
+ < script src ="/dist/main.js "> </ script >
Original file line number Diff line number Diff line change
1
+ {
2
+ "private" : true ,
3
+ "scripts" : {
4
+ "dev" : " webpack-dev-server" ,
5
+ "build" : " webpack --env.prod"
6
+ },
7
+ "dependencies" : {
8
+ "vue" : " ^3.0.0-beta.2"
9
+ },
10
+ "devDependencies" : {
11
+ "@vue/compiler-sfc" : " ^3.0.0-beta.2" ,
12
+ "css-loader" : " ^3.4.2" ,
13
+ "file-loader" : " ^6.0.0" ,
14
+ "mini-css-extract-plugin" : " ^0.9.0" ,
15
+ "url-loader" : " ^4.0.0" ,
16
+ "vue-loader" : " ^16.0.0-alpha.3" ,
17
+ "webpack" : " ^4.42.1" ,
18
+ "webpack-cli" : " ^3.3.11" ,
19
+ "webpack-dev-server" : " ^3.10.3"
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <img src =" ./logo.png" >
3
+ <h1 >Hello Vue 3!</h1 >
4
+ <button @click =" inc" >Clicked {{ count }} times.</button >
5
+ </template >
6
+
7
+ <script >
8
+ import { ref } from ' vue'
9
+
10
+ export default {
11
+ setup () {
12
+ const count = ref (0 )
13
+ const inc = () => {
14
+ count .value ++
15
+ }
16
+
17
+ return {
18
+ count,
19
+ inc
20
+ }
21
+ }
22
+ }
23
+ </script >
24
+
25
+ <style scoped>
26
+ img {
27
+ width : 200px ;
28
+ }
29
+ h1 {
30
+ font-family : Arial , Helvetica , sans-serif ;
31
+ }
32
+ </style >
Original file line number Diff line number Diff line change
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+
4
+ createApp ( App ) . mount ( '#app' )
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' )
2
+ const { VueLoaderPlugin } = require ( 'vue-loader' )
3
+ const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
4
+
5
+ module . exports = ( env = { } ) => ( {
6
+ mode : env . prod ? 'production' : 'development' ,
7
+ devtool : env . prod ? 'source-map' : 'cheap-module-eval-source-map' ,
8
+ entry : path . resolve ( __dirname , './src/main.js' ) ,
9
+ output : {
10
+ path : path . resolve ( __dirname , './dist' ) ,
11
+ publicPath : '/dist/'
12
+ } ,
13
+ resolve : {
14
+ alias : {
15
+ // this isn't technically needed, since the default `vue` entry for bundlers
16
+ // is a simple `export * from '@vue/runtime-dom`. However having this
17
+ // extra re-export somehow causes webpack to always invalidate the module
18
+ // on the first HMR update and causes the page to reload.
19
+ 'vue' : '@vue/runtime-dom'
20
+ }
21
+ } ,
22
+ module : {
23
+ rules : [
24
+ {
25
+ test : / \. v u e $ / ,
26
+ use : 'vue-loader'
27
+ } ,
28
+ {
29
+ test : / \. p n g $ / ,
30
+ use : {
31
+ loader : 'url-loader' ,
32
+ options : { limit : 8192 }
33
+ }
34
+ } ,
35
+ {
36
+ test : / \. c s s $ / ,
37
+ use : [
38
+ {
39
+ loader : MiniCssExtractPlugin . loader ,
40
+ options : { hmr : ! env . prod }
41
+ } ,
42
+ 'css-loader'
43
+ ]
44
+ }
45
+ ]
46
+ } ,
47
+ plugins : [
48
+ new VueLoaderPlugin ( ) ,
49
+ new MiniCssExtractPlugin ( {
50
+ filename : '[name].css'
51
+ } )
52
+ ] ,
53
+ devServer : {
54
+ inline : true ,
55
+ hot : true ,
56
+ stats : 'minimal' ,
57
+ contentBase : __dirname ,
58
+ overlay : true
59
+ }
60
+ } )
You can’t perform that action at this time.
0 commit comments