This commit is contained in:
Sébastien Chopin 2016-10-26 13:40:55 +02:00
parent 0072ed31da
commit 6cce8b161a
3 changed files with 146 additions and 1 deletions

12
.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
# build output
dist
# dependencies
yarn.lock
node_modules
# logs
npm-debug.log
# other
.nuxt

View File

@ -1,2 +1,51 @@
## WIP: NOT WORKING right now!
# nuxt.js
A minimalistic framework for server-rendered Vue applications (inspired from Next.js)
>A minimalistic framework for server-rendered Vue applications (completely inspired from [Next.js](https://github.com/zeit/next.js))
## How to use
Install it:
```
$ npm install nuxt --save
```
and add a script to your package.json like this:
```json
{
"scripts": {
"start": "nuxt"
}
}
```
After that, the file-system is the main API. Every `.vue` file becomes a route that gets automatically processed and rendered.
Populate `./pages/index.vue` inside your project:
```html
<template>
<h1>Hello {{ name }}!</h1>
</template>
<script>
export default {
data: () => ({
name: 'world'
})
}
</script>
```
and then just run `npm start` and go to `http://localhost:3000`
So far, we get:
- Automatic transpilation and bundling (with webpack and babel)
- Hot code reloading
- Server rendering and indexing of `./pages`
- Static file serving. `./static/` is mapped to `/static/`
To see how simple this is, check out the [sample app - nuxtgram](https://github.com/atinux/nuxtgram)

84
package.json Normal file
View File

@ -0,0 +1,84 @@
{
"name": "nuxt",
"version": "0.0.1",
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
"main": "./dist/lib/index.js",
"license": "MIT",
"repository": "Atinux/nuxt.js",
"files": [
"dist"
],
"bin": {
"next": "./dist/bin/nuxt"
},
"scripts": {
"build": "gulp",
"test": "standard && gulp test",
"lint": "standard",
"prepublish": "gulp release",
"precommit": "npm run lint"
},
"ava": {
"babel": {
"presets": [
"es2015",
"react"
],
"plugins": [
"transform-async-to-generator",
"transform-object-rest-spread",
"transform-class-properties",
"transform-runtime"
]
}
},
"standard": {
"parser": "babel-eslint"
},
"dependencies": {
"babel-core": "6.17.0",
"babel-generator": "6.17.0",
"babel-loader": "6.2.5",
"babel-plugin-module-alias": "1.6.0",
"babel-plugin-transform-async-to-generator": "6.16.0",
"babel-plugin-transform-class-properties": "6.16.0",
"babel-plugin-transform-object-rest-spread": "6.16.0",
"babel-plugin-transform-runtime": "6.15.0",
"babel-preset-es2015": "6.16.0",
"babel-preset-react": "6.16.0",
"babel-runtime": "6.11.6",
"cross-spawn": "4.0.2",
"del": "2.2.2",
"glamor": "2.17.10",
"glob-promise": "1.0.6",
"htmlescape": "1.1.1",
"loader-utils": "0.2.16",
"minimist": "1.2.0",
"mz": "2.4.0",
"path-match": "1.2.4",
"react": "15.3.2",
"react-dom": "15.3.2",
"react-hot-loader": "3.0.0-beta.6",
"send": "0.14.1",
"strip-ansi": "3.0.1",
"url": "0.11.0",
"webpack": "1.13.2",
"webpack-dev-server": "1.16.2",
"write-file-webpack-plugin": "3.3.0"
},
"devDependencies": {
"babel-eslint": "7.0.0",
"babel-plugin-transform-remove-strict-mode": "0.0.2",
"benchmark": "2.1.1",
"gulp": "3.9.1",
"gulp-ava": "0.14.1",
"gulp-babel": "6.1.2",
"gulp-benchmark": "1.1.1",
"gulp-cached": "1.1.0",
"gulp-notify": "2.2.0",
"husky": "0.11.9",
"run-sequence": "1.2.2",
"standard": "^8.4.0",
"webpack-stream": "3.2.0"
}
}