Skip to content

Commit c4be3d4

Browse files
committed
cli init
1 parent 5217ec3 commit c4be3d4

File tree

26 files changed

+170
-31
lines changed

26 files changed

+170
-31
lines changed

meta.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
'prompts': {
3+
'name': {
4+
'type': 'string',
5+
'required': true,
6+
'message': 'Project name'
7+
},
8+
'description': {
9+
'type': 'string',
10+
'required': false,
11+
'message': 'Project description',
12+
'default': 'A Vue.js project'
13+
},
14+
'author': {
15+
'type': 'string',
16+
'message': 'Author'
17+
}
18+
},
19+
'completeMessage': 'To get started:\n\n {{^inPlace}}cd {{destDirName}}\n {{/inPlace}}npm install\n npm run dev\n\nDocumentation can be found at https://github.com/Plortinus/vue-multiple-pages'
20+
}

package.json

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,9 @@
11
{
22
"name": "vue-multiple-pages",
3-
"description": "A Vue2 starter",
4-
"author": "plortinus@gmail.com",
3+
"version": "1.0.0",
54
"license": "MIT",
6-
"scripts": {
7-
"dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot",
8-
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
9-
},
10-
"dependencies": {
11-
"element-ui": "^1.2.8",
12-
"vue": "^2.2.6"
13-
},
5+
"description": "A modern Vue.js multiple pages starter which uses Vue 2, Webpack2, and Element-UI",
146
"devDependencies": {
15-
"autoprefixer": "^6.7.7",
16-
"babel-core": "^6.24.1",
17-
"babel-loader": "^6.4.1",
18-
"babel-preset-es2015": "^6.24.1",
19-
"cross-env": "^4.0.0",
20-
"css-loader": "^0.28.0",
21-
"eslint": "^3.19.0",
22-
"eslint-config-vue": "^2.0.2",
23-
"eslint-plugin-vue": "^2.0.1",
24-
"extract-text-webpack-plugin": "^2.1.0",
25-
"file-loader": "^0.11.1",
26-
"glob": "^7.1.1",
27-
"html-loader": "^0.4.5",
28-
"html-webpack-plugin": "^2.28.0",
29-
"postcss-loader": "^1.3.3",
30-
"style-loader": "^0.16.1",
31-
"url-loader": "^0.5.8",
32-
"vue-loader": "^11.3.4",
33-
"vue-template-compiler": "^2.2.6",
34-
"webpack": "^2.3.3",
35-
"webpack-dev-server": "^2.4.2"
7+
"vue-cli": "^2.8.1"
368
}
379
}
File renamed without changes.
File renamed without changes.

template/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log
5+
.idea

template/README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# {{ name }}
2+
3+
> {{ description }}
4+
5+
## Features
6+
7+
1. [Vue2](https://github.com/vuejs/vue)
8+
2. [Webpack2](https://github.com/webpack/webpack)
9+
3. [ElementUI](https://github.com/ElemeFE/element)
10+
4. [Eslint](https://github.com/eslint/eslint)
11+
5. [Postcss](https://github.com/postcss/postcss)
12+
13+
## Dev
14+
15+
``` bash
16+
# serve with hot reload at localhost:8010
17+
npm run dev
18+
19+
```
20+
21+
[http://localhost:8010/user/login.html](http://localhost:8010/user/login.html)
22+
23+
[http://localhost:8010/user/index.html](http://localhost:8010/user/index.html)
24+
25+
[http://localhost:8010/customer/index.html](http://localhost:8010/customer/index.html)
26+
27+
## Build
28+
29+
``` bash
30+
# build for production with minification
31+
npm run build // Firstly
32+
node server.js // Secondly
33+
34+
```
35+
Then visit the pages
36+
[http://localhost:2333/user/login.html](http://localhost:2333/user/login.html)
37+
38+
## Root Folder Structure
39+
40+
```bash
41+
├── src # main folder
42+
│   ├── assets # common assets folder
43+
│   │   ├── img
44+
│   │   │   └── logo.png
45+
│   │   ├── js
46+
│   │   └── css
47+
│   ├── components # common components folder
48+
│   │   └── modal.vue
49+
│   └── pages # pages
50+
│   ├── user # user part (folder name can be customized)
51+
│   │   ├── login # login.html (folder name can be customized)
52+
│   │   │   ├── app.js # entry js (file name can't be customized unless you change the webpack.config.js)
53+
│   │   │   ├── app.vue # login vue (file name can be customized)
54+
│   │   │   └── app.html # template html (file name can't be customized unless you change the webpack.config.js)
55+
│   │   └── index # index.html
56+
│   │   ├── app.js
57+
│   │   ├── app.html
58+
│   │   └── app.vue
59+
│   └── customer # customer part (folder name can be customized)
60+
│   └── home # home.html
61+
│   ├── app.html
62+
│   ├── app.js
63+
│   └── app.vue
64+
├── LICENSE
65+
├── .babelrc # babel config (es2015 default)
66+
├── .eslintrc.js # eslint config (eslint-config-vue default)
67+
├── server.js # port 2333
68+
├── package.json
69+
├── postcss.config.js # postcss (autoprefixer default)
70+
├── webpack.config.js
71+
└── README.md
72+
```
73+
74+
## Dist Folder Structure
75+
76+
```bash
77+
├── assets
78+
│ ├── css
79+
│ │ ├── customer
80+
│ │ │ ├── home.css
81+
│ │ │ └── home.css.map
82+
│ │ ├── user
83+
│ │ │ ├── index.css
84+
│ │ │ ├── index.css.map
85+
│ │ │ ├── login.css
86+
│ │ │ └── login.css.map
87+
│ │ ├── vendors.css
88+
│ │ └── vendors.css.map
89+
│ └── js
90+
│ ├── customer
91+
│ │ └── home.js
92+
│ ├── user
93+
│ │ ├── index.js
94+
│ │ └── login.js
95+
│ └── vendors.js
96+
├── b02bdc1b846fd65473922f5f62832108.ttf
97+
├── customer
98+
│ └── home.html
99+
├── logo.png
100+
└── user
101+
├── index.html
102+
└── login.html
103+
```
104+
105+
For detailed explanation on how things work, checkout the [guide](https://github.com/Plortinus/vue-multiple-pages)

template/package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "{{ name }}",
3+
"description": "{{ description }}",
4+
"author": "{{ author }}",
5+
"private": true,
6+
"scripts": {
7+
"dev": "cross-env NODE_ENV=development webpack-dev-server --inline --hot",
8+
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
9+
},
10+
"dependencies": {
11+
"element-ui": "^1.2.8",
12+
"vue": "^2.2.6"
13+
},
14+
"devDependencies": {
15+
"autoprefixer": "^6.7.7",
16+
"babel-core": "^6.24.1",
17+
"babel-loader": "^6.4.1",
18+
"babel-preset-es2015": "^6.24.1",
19+
"cross-env": "^4.0.0",
20+
"css-loader": "^0.28.0",
21+
"eslint": "^3.19.0",
22+
"eslint-config-vue": "^2.0.2",
23+
"eslint-plugin-vue": "^2.0.1",
24+
"extract-text-webpack-plugin": "^2.1.0",
25+
"file-loader": "^0.11.1",
26+
"glob": "^7.1.1",
27+
"html-loader": "^0.4.5",
28+
"html-webpack-plugin": "^2.28.0",
29+
"postcss-loader": "^1.3.3",
30+
"style-loader": "^0.16.1",
31+
"url-loader": "^0.5.8",
32+
"vue-loader": "^11.3.4",
33+
"vue-template-compiler": "^2.2.6",
34+
"webpack": "^2.3.3",
35+
"webpack-dev-server": "^2.4.2"
36+
}
37+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)