Skip to content

Commit 91517c2

Browse files
author
zanjs
committed
🐶 vue
0 parents  commit 91517c2

12 files changed

+375
-0
lines changed

.babelrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
presets: ['es2015'],
3+
plugins: ['transform-runtime']
4+
}

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true,
6+
},
7+
8+
"ecmaFeatures": {
9+
"modules": 1
10+
},
11+
12+
"rules": {
13+
"accessor-pairs": 2,
14+
"array-bracket-spacing": 0,
15+
"block-scoped-var": 0,
16+
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
17+
"camelcase": 0,
18+
"comma-dangle": [2, "never"],
19+
"comma-spacing": [2, { "before": false, "after": true }],
20+
"comma-style": [2, "last"],
21+
"complexity": 0,
22+
"computed-property-spacing": 0,
23+
"consistent-return": 0,
24+
"consistent-this": 0,
25+
"constructor-super": 2,
26+
"curly": [2, "multi-line"],
27+
"default-case": 0,
28+
"dot-location": [2, "property"],
29+
"dot-notation": 0,
30+
"eol-last": 2,
31+
"eqeqeq": [2, "allow-null"],
32+
"func-names": 0,
33+
"func-style": 0,
34+
"generator-star": 0,
35+
"generator-star-spacing": [2, { "before": true, "after": true }],
36+
"global-strict": 0,
37+
"guard-for-in": 0,
38+
"handle-callback-err": [2, "^(err|error)$" ],
39+
"indent": [2, 2],
40+
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
41+
"linebreak-style": 0,
42+
"lines-around-comment": 0,
43+
"max-depth": 0,
44+
"max-len": 0,
45+
"max-nested-callbacks": 0,
46+
"max-params": 0,
47+
"max-statements": 0,
48+
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
49+
"new-parens": 2,
50+
"newline-after-var": 0,
51+
"no-alert": 0,
52+
"no-array-constructor": 2,
53+
"no-bitwise": 0,
54+
"no-caller": 2,
55+
"no-catch-shadow": 0,
56+
"no-comma-dangle": 0,
57+
"no-cond-assign": 2,
58+
"no-console": 0,
59+
"no-constant-condition": 0,
60+
"no-continue": 0,
61+
"no-control-regex": 2,
62+
"no-debugger": 2,
63+
"no-delete-var": 2,
64+
"no-div-regex": 0,
65+
"no-dupe-args": 2,
66+
"no-dupe-keys": 2,
67+
"no-duplicate-case": 2,
68+
"no-else-return": 0,
69+
"no-empty": 0,
70+
"no-empty-character-class": 2,
71+
"no-empty-class": 0,
72+
"no-empty-label": 2,
73+
"no-eq-null": 0,
74+
"no-eval": 2,
75+
"no-ex-assign": 2,
76+
"no-extend-native": 2,
77+
"no-extra-bind": 2,
78+
"no-extra-boolean-cast": 2,
79+
"no-extra-parens": 0,
80+
"no-extra-semi": 0,
81+
"no-extra-strict": 0,
82+
"no-fallthrough": 2,
83+
"no-floating-decimal": 2,
84+
"no-func-assign": 2,
85+
"no-implied-eval": 2,
86+
"no-inline-comments": 0,
87+
"no-inner-declarations": [2, "functions"],
88+
"no-invalid-regexp": 2,
89+
"no-irregular-whitespace": 2,
90+
"no-iterator": 2,
91+
"no-label-var": 2,
92+
"no-labels": 2,
93+
"no-lone-blocks": 2,
94+
"no-lonely-if": 0,
95+
"no-loop-func": 0,
96+
"no-mixed-requires": 0,
97+
"no-mixed-spaces-and-tabs": 2,
98+
"no-multi-spaces": 2,
99+
"no-multi-str": 2,
100+
"no-multiple-empty-lines": [2, { "max": 1 }],
101+
"no-native-reassign": 2,
102+
"no-negated-in-lhs": 2,
103+
"no-nested-ternary": 0,
104+
"no-new": 2,
105+
"no-new-func": 0,
106+
"no-new-object": 2,
107+
"no-new-require": 2,
108+
"no-new-wrappers": 2,
109+
"no-obj-calls": 2,
110+
"no-octal": 2,
111+
"no-octal-escape": 2,
112+
"no-param-reassign": 0,
113+
"no-path-concat": 0,
114+
"no-plusplus": 0,
115+
"no-process-env": 0,
116+
"no-process-exit": 0,
117+
"no-proto": 0,
118+
"no-redeclare": 2,
119+
"no-regex-spaces": 2,
120+
"no-reserved-keys": 0,
121+
"no-restricted-modules": 0,
122+
"no-return-assign": 2,
123+
"no-script-url": 0,
124+
"no-self-compare": 2,
125+
"no-sequences": 2,
126+
"no-shadow": 0,
127+
"no-shadow-restricted-names": 2,
128+
"no-space-before-semi": 0,
129+
"no-spaced-func": 2,
130+
"no-sparse-arrays": 2,
131+
"no-sync": 0,
132+
"no-ternary": 0,
133+
"no-this-before-super": 2,
134+
"no-throw-literal": 2,
135+
"no-trailing-spaces": 2,
136+
"no-undef": 2,
137+
"no-undef-init": 2,
138+
"no-undefined": 0,
139+
"no-underscore-dangle": 0,
140+
"no-unexpected-multiline": 2,
141+
"no-unneeded-ternary": 2,
142+
"no-unreachable": 2,
143+
"no-unused-expressions": 0,
144+
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
145+
"no-use-before-define": 0,
146+
"no-var": 0,
147+
"no-void": 0,
148+
"no-warning-comments": 0,
149+
"no-with": 2,
150+
"object-curly-spacing": 0,
151+
"object-shorthand": 0,
152+
"one-var": [2, { "initialized": "never" }],
153+
"operator-assignment": 0,
154+
"operator-linebreak": [2, "after"],
155+
"padded-blocks": 0,
156+
"prefer-const": 0,
157+
"quote-props": 0,
158+
"quotes": [2, "single", "avoid-escape"],
159+
"radix": 2,
160+
"semi": [2, "never"],
161+
"semi-spacing": 0,
162+
"sort-vars": 0,
163+
"space-after-function-name": 0,
164+
"space-after-keywords": [2, "always"],
165+
"space-before-blocks": [2, "always"],
166+
"space-before-function-paren": [2, "always"],
167+
"space-before-function-parentheses": 0,
168+
"space-in-brackets": 0,
169+
"space-in-parens": [2, "never"],
170+
"space-infix-ops": 2,
171+
"space-return-throw-case": 2,
172+
"space-unary-ops": [2, { "words": true, "nonwords": false }],
173+
"spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }],
174+
"spaced-line-comment": 0,
175+
"strict": 0,
176+
"use-isnan": 2,
177+
"valid-jsdoc": 0,
178+
"valid-typeof": 2,
179+
"vars-on-top": 0,
180+
"wrap-iife": [2, "any"],
181+
"wrap-regex": 0,
182+
"yoda": [2, "never"]
183+
}
184+
}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
node_modules
3+
.yo-rc.json
4+
*.log

build/bundle.js

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>gen vue</title>
6+
<meta name="description" content="gen vue">
7+
<meta name="viewport" content="width=device-width">
8+
</head>
9+
<body>
10+
<!--[if lt IE 10]>
11+
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
12+
<![endif]-->
13+
<app></app>
14+
<script src="./build/bundle.js"></script>
15+
</body>
16+
</html>

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "gen-vue",
3+
"version": "0.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"dev": "webpack-dev-server --inline --hot --quiet",
8+
"build": "rm -rf build/* && webpack --progress --hide-modules --config webpack.production.js"
9+
},
10+
"dependencies": {
11+
"vue-router": "^0.7.6",
12+
"vue": "^1.0.8"
13+
},
14+
"devDependencies": {
15+
"vue-loader": "^7.0.3",
16+
"vue-hot-reload-api": "^1.2.0",
17+
"vue-html-loader": "^1.0.0",
18+
"style-loader": "^0.13.0",
19+
"css-loader": "^0.21.0",
20+
"babel-runtime": "^5.8.0",
21+
"babel-loader": "^6.1.0",
22+
"babel-core": "^6.1.21",
23+
"babel-preset-es2015": "^6.1.18",
24+
"babel-plugin-transform-runtime": "^6.1.18",
25+
"file-loader": "^0.8.5",
26+
"url-loader": "^0.5.7",
27+
"webpack": "^1.12.2",
28+
"extract-text-webpack-plugin": "^0.9.1",
29+
"webpack-dev-server": "^1.12.1"
30+
},
31+
"peerDependencies": {
32+
}
33+
}

src/app.vue

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div class="main">
3+
<input type="text" v-model="text" />
4+
<div class="hello">Hello {{ text }}!</div>
5+
</div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
replace: false,
11+
data() {
12+
return {
13+
text: 'vue'
14+
}
15+
}
16+
}
17+
</script>

src/main.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Vue from 'vue'
2+
import app from './app.vue'
3+
import VueRouter from 'vue-router'
4+
5+
import './styles.css'
6+
7+
Vue.config.debug = process.env.NODE_ENV !== 'production'
8+
9+
Vue.use(VueRouter)
10+
11+
const router = new VueRouter()
12+
const App = Vue.extend(app)
13+
14+
router.start(App, 'body')

src/styles.css

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.browsehappy {
2+
margin: 0.2em 0;
3+
background: #ccc;
4+
color: #000;
5+
padding: 0.2em 0;
6+
}
7+
8+
/* Space out content a bit */
9+
body {
10+
padding-top: 20px;
11+
padding-bottom: 20px;
12+
}

webpack.config.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
entry: {
3+
app: './src/main.js'
4+
},
5+
output: {
6+
path: './build',
7+
publicPath: '/build/',
8+
filename: 'bundle.js'
9+
},
10+
module: {
11+
loaders: [
12+
{ test: /\.vue$/, loader: 'vue' },
13+
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
14+
{ test: /\.(png|jpg)$/, loader: 'file' },
15+
{ test: /\.(png|jpg)$/, loader: 'url?limit=10000'},
16+
{ test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff' },
17+
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream' },
18+
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
19+
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' },
20+
{ test: /\.css$/, loader: 'style-loader!css-loader' }
21+
]
22+
},
23+
devtool: '#source-map'
24+
}

webpack.production.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
var webpack = require('webpack')
2+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
3+
4+
module.exports = {
5+
entry: {
6+
app: './src/main.js'
7+
},
8+
output: {
9+
path: './build',
10+
publicPath: '/build/',
11+
filename: 'bundle.js'
12+
},
13+
module: {
14+
loaders: [
15+
{ test: /\.vue$/, loader: 'vue' },
16+
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
17+
{ test: /\.(png|jpg)$/, loader: 'file' },
18+
{ test: /\.(png|jpg)$/, loader: 'url?limit=10000'},
19+
{ test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff' },
20+
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream' },
21+
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
22+
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' },
23+
{ test: /\.css$/, loader: 'style-loader!css-loader' }
24+
]
25+
},
26+
plugins: [
27+
new webpack.DefinePlugin({
28+
'process.env': {
29+
NODE_ENV: '"production"'
30+
}
31+
}),
32+
new webpack.optimize.UglifyJsPlugin({
33+
compress: {
34+
warnings: false
35+
}
36+
}),
37+
new ExtractTextPlugin('[name].min.css', {
38+
allChunks: true
39+
})
40+
],
41+
vue: {
42+
loaders: {
43+
css: ExtractTextPlugin.extract('css')
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)