use nuxt.js build target

This commit is contained in:
Pooya Parsa 2017-06-20 16:42:21 +04:30
parent b6544637e0
commit 5ad640b294
5 changed files with 18 additions and 16 deletions

View File

@ -13,10 +13,4 @@ require('source-map-support').install();
/* istanbul ignore else */
process.noDeprecation = true
// Require Core
const Core = require('./dist/core.js')
Object.assign(exports, Core)
// Require Builder
const Builder = require('./dist/builder.js')
Object.assign(exports, Builder)
module.exports = require('./dist/nuxt')

View File

@ -56,13 +56,13 @@ export default class Nuxt extends Tapable {
console.log('\n' + chalk.bold(chalk.bgBlue.black(' OPEN ') + chalk.blue(` http://${_host}:${port}\n`)))
// Close server on nuxt close
this.plugin('close', () => new Promise((_resolve, _reject) => {
server.close(_err => {
this.plugin('close', () => new Promise((resolve, reject) => {
server.close(err => {
debug('server closed')
if (_err) {
return _reject(err)
if (err) {
return reject(err)
}
_resolve()
resolve()
})
}))

4
lib/index.js Executable file
View File

@ -0,0 +1,4 @@
import core from './core'
import builder from './builder'
export default Object.assign({}, core, builder)

View File

@ -48,14 +48,14 @@
]
},
"scripts": {
"test": "npm run lint && cross-env NODE_ENV=test npm run build && nyc ava --verbose --serial test/ -- && nyc report --reporter=html",
"test": "npm run lint && cross-env NODE_ENV=test npm run build:nuxt && nyc ava --verbose --serial test/ -- && nyc report --reporter=html",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "eslint --ext .js,.vue bin lib pages test/*.js --ignore-pattern app",
"build": "rimraf dist/ && npm run build:core && npm run build:builder",
"build": "rimraf dist/ && npm run build:nuxt && npm run build:core && npm run build:builder",
"build:nuxt": "rollup -c rollup.config.js --environment TARGET:nuxt",
"build:core": "rollup -c rollup.config.js --environment TARGET:core",
"watch": "npm run build:core -- -w",
"build:builder": "rollup -c rollup.config.js --environment TARGET:builder",
"watch:builder": "npm run build:builder -- -w",
"watch": "npm run build:nuxt -- -w",
"precommit": "npm run lint",
"prepublish": "npm run build",
"postinstall": "opencollective postinstall"

View File

@ -38,6 +38,10 @@ const aliases = {
// Builds
// -----------------------------
const builds = {
nuxt: {
entry: resolve(libDir, 'index.js'),
dest: resolve(distDir, 'nuxt.js')
},
core: {
entry: resolve(libDir, 'core/index.js'),
dest: resolve(distDir, 'core.js')