node >= 6.0.0
$ npm install -g vue-cli
$ vue init nuxt-egg/starter my_project
or
$ npm install -g egg-init
$ egg-init --package=egg-boilerplate-nuxt my_project
$ cd my_prject
$ npm install
$ npm run dev
Look at egg-framework
nuxt-egg-project
βββ .nuxt
βββ resources
| βββ pages
β βββ assets
β | βββ css
β | βββ img
β βββ static
β βββ layouts
β βββ middleware
β βββ plugins
β βββ components
βββ package.json
βββ app.js (option)
βββ agent.js (option)
βββ app
| βββ router.js
β βββ controller
β | βββ home.js
β βββ service (option)
β | βββ user.js
β βββ middleware (option)
β | βββ response_time.js
β βββ schedule (option)
β | βββ my_task.js
β βββ public (option)
β | βββ reset.css
β βββ view (option)
β | βββ home.tpl
β βββ extend (option)
β βββ helper.js (option)
β βββ request.js (option)
β βββ response.js (option)
β βββ context.js (option)
β βββ application.js (option)
β βββ agent.js (option)
βββ config
| βββ plugin.js
| βββ config.default.js
β βββ config.prod.js
| βββ config.test.js (option)
| βββ config.local.js (option)
| βββ config.unittest.js (option)
βββ test
βββ middleware
| βββ response_time.test.js
βββ controller
βββ home.test.js
- The Nuxt config file is now in
config.[dev].js
,dev
allow setdefault
,unittest
,local
,prod
- The Nuxt project directory is
resources
(default)
const path = require('path');
exports.nuxt = {
srcDir: path.join(__dirname, '../resources'),
rootDir: path.dirname(__dirname),
}
Or you can also do this
// config/config.default.js
exports.nuxt = require('./config.nuxt.js');
// config/config.nuxt.js
module.exports = {
srcDir: ''
rootDir: ''
}
- egg-init doesn't support download image now, so the logo.png will not be open normal.