refactor: link build folder

This commit is contained in:
Clark Du 2017-11-25 21:52:42 +08:00
parent a29eb99d49
commit 1a8089f906
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
3 changed files with 6 additions and 5 deletions

View File

@ -51,7 +51,7 @@ const builds = {
// -----------------------------
// Default config
// -----------------------------
function genConfig (opts) {
function genConfig(opts) {
const config = {
input: opts.entry,
output: {

View File

@ -3,7 +3,7 @@
const now = Date.now()
const { readFileSync, readJSONSync, writeFileSync, copySync, removeSync } = require('fs-extra')
const { resolve, relative } = require('path')
const { resolve } = require('path')
// Dirs
const rootDir = resolve(__dirname, '..')
@ -42,6 +42,7 @@ requires = requires.filter(r => excludes.indexOf(r) === -1)
let dependencies = {}
requires.forEach(r => {
if (!packageJSON.dependencies[r]) {
// eslint-disable-next-line no-console
console.warn('Cannot resolve dependency version for ' + r)
return
}
@ -104,5 +105,5 @@ writeFileSync(startIndexjs, String(readFileSync(startIndexjs)).replace('./dist/n
const binStart = resolve(startDir, 'bin/nuxt-start')
writeFileSync(binStart, String(readFileSync(binStart)).replace(/nuxt start/g, 'nuxt-start'))
const ms = Date.now() - now
console.log(`Generated ${packageJSON.name}@${packageJSON.version} in ${ms}ms`)
// eslint-disable-next-line no-console
console.log(`Generated ${packageJSON.name}@${packageJSON.version} in ${Date.now() - now}ms`)

View File

@ -49,7 +49,7 @@
"scripts": {
"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/ test/ examples/",
"lint": "eslint --ext .js,.vue bin/ build/ lib/ test/ examples/",
"build": "rimraf dist/ && npm run build:nuxt && npm run build:core",
"build:nuxt": "rollup -c build/rollup.config.js --environment TARGET:nuxt",
"build:core": "rollup -c build/rollup.config.js --environment TARGET:core",