Browse Source

init

pull/1/head
Evan You 10 years ago
commit
02f3387fce
  1. 31
      README.md
  2. 22
      meta.json
  3. 4
      template/.babelrc
  4. 4
      template/.gitignore
  5. 16
      template/README.md
  6. 0
      template/dist/.gitkeep
  7. 11
      template/index.html
  8. 38
      template/package.json
  9. 21
      template/src/App.vue
  10. 7
      template/src/main.js

31
README.md

@ -0,0 +1,31 @@
# vue-browserify-simple-boilerplate
> A simple Browserify + `vueify` setup for quick prototyping.
### Usage
This is a project template for [vue-cli](https://github.com/vuejs/vue-cli).
``` bash
$ npm install -g vue-cli
$ vue init browserify-simple my-project
$ cd my-project
$ npm install
$ npm run dev
```
### What's Included
- `npm run dev`: Browserify + `vueify` with proper config for source map & hot-reload.
- `npm run build`: Production build with HTML/CSS/JS minification.
For more information see the [docs for vueify](https://github.com/vuejs/vueify).
### Fork It And Make Your Own
You can fork this repo to create your own boilerplate, and use it with `vue-cli`:
``` bash
vue init username/repo my-project
```

22
meta.json

@ -0,0 +1,22 @@
{
"schema": {
"name": {
"type": "string",
"required": true,
"label": "Project name"
},
"description": {
"type": "string",
"required": true,
"label": "Project description"
},
"author": {
"type": "string",
"label": "Author"
},
"private": {
"type": "boolean",
"default": true
}
}
}

4
template/.babelrc

@ -0,0 +1,4 @@
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"]
}

4
template/.gitignore

@ -0,0 +1,4 @@
.DS_Store
node_modules/
dist/build.js
npm-debug.log

16
template/README.md

@ -0,0 +1,16 @@
# {{ name }}
> {{ description }}
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
```

0
template/dist/.gitkeep

11
template/index.html

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ name }}</title>
</head>
<body>
<app></app>
<script src="dist/build.js"></script>
</body>
</html>

38
template/package.json

@ -0,0 +1,38 @@
{
"name": "{{ name }}",
"description": "{{ description }}",
"author": "{{ author }}",
{{#private}}
"private": true,
{{/private}}
"scripts": {
"dev": "watchify -vd -p browserify-hmr -e src/main.js -o dist/build.js & http-server -c 1 -a localhost",
"build": "cross-env NODE_ENV=production browserify src/main.js | uglifyjs -c warnings=false -m > dist/build.js"
},
"dependencies": {
"vue": "^1.0.0"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"babel-runtime": "^5.8.0",
"cross-env": "^1.0.6",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"browserify-hmr": "^0.3.1",
"http-server": "^0.8.5",
"uglify-js": "^2.5.0",
"vue-hot-reload-api": "^1.2.2",
"vueify": "^8.0.0",
"vueify-insert-css": "^1.0.0",
"watchify": "^3.4.0"
},
"browserify": {
"transform": [
"vueify",
"babelify"
]
}
}

21
template/src/App.vue

@ -0,0 +1,21 @@
<template>
<div id="app">
<h1>\{{ msg }}</h1>
</div>
</template>
<script>
export default {
data () {
return {
msg: 'Hello Vue!'
}
}
}
</script>
<style>
body {
font-family: Helvetica, sans-serif;
}
</style>

7
template/src/main.js

@ -0,0 +1,7 @@
import Vue from 'vue'
import App from './App.vue'
new Vue({
el: 'body',
components: { App }
})
Loading…
Cancel
Save