This commit is contained in:
Pooya Parsa 2017-06-16 02:58:08 +04:30
parent 5722a92c4c
commit 644d19f7ec
6 changed files with 9 additions and 14 deletions

View File

@ -8,8 +8,7 @@ import serialize from 'serialize-javascript'
import { join, resolve, basename, dirname } from 'path' import { join, resolve, basename, dirname } from 'path'
import Tapable from 'tappable' import Tapable from 'tappable'
import MFS from 'memory-fs' import MFS from 'memory-fs'
import { sequence, parallel } from "./utils" import { r, wp, createRoutes, parallel } from './utils'
import { r, wp, createRoutes } from './utils'
import clientWebpackConfig from './webpack/client.config.js' import clientWebpackConfig from './webpack/client.config.js'
import serverWebpackConfig from './webpack/server.config.js' import serverWebpackConfig from './webpack/server.config.js'
@ -294,7 +293,7 @@ export default class Builder extends Tapable {
} }
if (!this.options.dev) { if (!this.options.dev) {
// Show build stats for production // Show build stats for production
console.log(stats.toString(this.webpackStats)) // eslint-disable-line no-console console.log(stats.toString(this.webpackStats)) // eslint-disable-line no-console
if (stats.hasErrors()) { if (stats.hasErrors()) {
return reject(new Error('Webpack build exited with errors')) return reject(new Error('Webpack build exited with errors'))
} }
@ -326,7 +325,7 @@ export default class Builder extends Tapable {
// Run after each compile // Run after each compile
this.compiler.plugin('done', stats => { this.compiler.plugin('done', stats => {
console.log(stats.toString(this.webpackStats)) // eslint-disable-line no-console console.log(stats.toString(this.webpackStats)) // eslint-disable-line no-console
// Reload renderer if available // Reload renderer if available
if (this.nuxt.renderer) { if (this.nuxt.renderer) {
this.nuxt.renderer.loadResources(mfs) this.nuxt.renderer.loadResources(mfs)

View File

@ -49,8 +49,8 @@ export default class Nuxt extends Tapable {
// Wait for all components to be ready // Wait for all components to be ready
await this.applyPluginsAsync('beforeInit') // 1- Modules await this.applyPluginsAsync('beforeInit') // 1- Modules
await this.applyPluginsAsync('init') // 2- Builder await this.applyPluginsAsync('init') // 2- Builder
await this.applyPluginsAsync('afterInit') // 3- Renderer await this.applyPluginsAsync('afterInit') // 3- Renderer
this.initialized = true this.initialized = true
return this return this

View File

@ -10,7 +10,6 @@ import _ from 'lodash'
import { resolve, join } from 'path' import { resolve, join } from 'path'
import fs from 'fs-extra' import fs from 'fs-extra'
import { createBundleRenderer } from 'vue-server-renderer' import { createBundleRenderer } from 'vue-server-renderer'
import chalk from 'chalk'
import { getContext, setAnsiColors, encodeHtml } from './utils' import { getContext, setAnsiColors, encodeHtml } from './utils'
const debug = require('debug')('nuxt:render') const debug = require('debug')('nuxt:render')

View File

@ -20,7 +20,7 @@ class Server {
} }
} }
async ready() { async ready () {
if (this._ready) { if (this._ready) {
return this._ready return this._ready
} }

View File

@ -1,8 +1,7 @@
import ExtractTextPlugin from 'extract-text-webpack-plugin' import ExtractTextPlugin from 'extract-text-webpack-plugin'
import { defaults } from 'lodash' import { defaults, cloneDeep } from 'lodash'
import { join, resolve, } from 'path' import { join, resolve } from 'path'
import webpack from 'webpack' import webpack from 'webpack'
import { cloneDeep } from 'lodash'
import { isUrl, urlJoin } from '../utils' import { isUrl, urlJoin } from '../utils'
import vueLoaderConfig from './vue-loader.config' import vueLoaderConfig from './vue-loader.config'
import { styleLoader, extractStyles } from './helpers' import { styleLoader, extractStyles } from './helpers'

View File

@ -1,11 +1,10 @@
import { each, defaults, flatten } from 'lodash' import { each } from 'lodash'
import webpack from 'webpack' import webpack from 'webpack'
import VueSSRClientPlugin from 'vue-server-renderer/client-plugin' import VueSSRClientPlugin from 'vue-server-renderer/client-plugin'
import HTMLPlugin from 'html-webpack-plugin' import HTMLPlugin from 'html-webpack-plugin'
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
import ProgressBarPlugin from 'progress-bar-webpack-plugin' import ProgressBarPlugin from 'progress-bar-webpack-plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import OfflinePlugin from 'offline-plugin'
import { resolve } from 'path' import { resolve } from 'path'
import base from './base.config.js' import base from './base.config.js'
@ -86,7 +85,6 @@ export default function webpackClientConfig () {
}) })
) )
// Define Env // Define Env
config.plugins.push( config.plugins.push(
new webpack.DefinePlugin(Object.assign(env, { new webpack.DefinePlugin(Object.assign(env, {