Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Commit 5a6678a

Browse files
committed
init
0 parents  commit 5a6678a

8 files changed

+4306
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
.DS_Store
3+
node_modules

index.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<link rel="stylesheet" href="/dist/main.css">
2+
<div id="app"></div>
3+
<script src="/dist/main.js"></script>

package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "webpack-dev-server",
5+
"build": "webpack --env.prod"
6+
},
7+
"dependencies": {
8+
"vue": "^3.0.0-alpha.0"
9+
},
10+
"devDependencies": {
11+
"@vue/compiler-sfc": "^3.0.0-alpha.0",
12+
"css-loader": "^3.4.0",
13+
"file-loader": "^5.0.2",
14+
"mini-css-extract-plugin": "^0.9.0",
15+
"url-loader": "^3.0.0",
16+
"vue-loader": "^16.0.0-alpha.0",
17+
"webpack": "^4.41.4",
18+
"webpack-cli": "^3.3.10",
19+
"webpack-dev-server": "^3.10.1"
20+
}
21+
}

src/App.vue

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<img src="./logo.png">
3+
<h1>{{ msg }}</h1>
4+
</template>
5+
6+
<script>
7+
export default {
8+
data() {
9+
return {
10+
msg: 'Hello Vue 3!'
11+
}
12+
}
13+
}
14+
</script>
15+
16+
<style scoped>
17+
img {
18+
width: 200px;
19+
}
20+
h1 {
21+
font-family: Arial, Helvetica, sans-serif;
22+
}
23+
</style>

src/logo.png

12.5 KB
Loading

src/main.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
4+
createApp().mount(App, '#app')

webpack.config.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
module: {
14+
rules: [
15+
{
16+
test: /\.vue$/,
17+
use: 'vue-loader'
18+
},
19+
{
20+
test: /\.png$/,
21+
use: {
22+
loader: 'url-loader',
23+
options: { limit: 8192 }
24+
}
25+
},
26+
{
27+
test: /\.css$/,
28+
use: [
29+
{
30+
loader: MiniCssExtractPlugin.loader,
31+
options: { hmr: !env.prod }
32+
},
33+
'css-loader'
34+
]
35+
}
36+
]
37+
},
38+
plugins: [
39+
new VueLoaderPlugin(),
40+
new MiniCssExtractPlugin({
41+
filename: '[name].css'
42+
})
43+
],
44+
devServer: {
45+
inline: true,
46+
hot: true,
47+
stats: 'minimal',
48+
contentBase: __dirname,
49+
overlay: true
50+
}
51+
})

0 commit comments

Comments
 (0)