From adb43fbc102f2355c4234279670db1984a81d88e Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 20 Jun 2017 00:44:13 +0430 Subject: [PATCH] better production source maps --- lib/builder/webpack/base.config.js | 18 +++++++++--------- lib/builder/webpack/server.config.js | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/builder/webpack/base.config.js b/lib/builder/webpack/base.config.js index e7396fe027..77592a731a 100644 --- a/lib/builder/webpack/base.config.js +++ b/lib/builder/webpack/base.config.js @@ -1,11 +1,11 @@ -import ExtractTextPlugin from "extract-text-webpack-plugin"; -import { cloneDeep, defaults } from "lodash"; -import { join, resolve } from "path"; -import webpack from "webpack"; -import { isUrl, urlJoin } from "utils"; -import autoprefixer from "autoprefixer"; -import vueLoaderConfig from "./vue-loader.config"; -import { extractStyles, styleLoader } from "./helpers"; +import ExtractTextPlugin from 'extract-text-webpack-plugin' +import { defaults, cloneDeep } from 'lodash' +import { join, resolve } from 'path' +import webpack from 'webpack' +import { isUrl, urlJoin } from 'utils' +import autoprefixer from 'autoprefixer' +import vueLoaderConfig from './vue-loader.config' +import { styleLoader, extractStyles } from './helpers' /* |-------------------------------------------------------------------------- @@ -28,7 +28,7 @@ export default function webpackBaseConfig ({ isClient, isServer }) { } const config = { - devtool: this.options.dev ? 'cheap-module-source-map' : false, + devtool: this.options.dev ? 'cheap-module-source-map' : 'nosources-source-map', entry: { vendor: ['vue', 'vue-router', 'vue-meta'] }, diff --git a/lib/builder/webpack/server.config.js b/lib/builder/webpack/server.config.js index 185a19a0fe..01a2fbf1d0 100644 --- a/lib/builder/webpack/server.config.js +++ b/lib/builder/webpack/server.config.js @@ -23,7 +23,8 @@ export default function webpackServerConfig () { config = Object.assign(config, { target: 'node', - devtool: (this.options.dev ? 'source-map' : false), + node: false, + devtool: 'source-map', entry: resolve(this.options.buildDir, 'server.js'), output: Object.assign({}, config.output, { filename: 'server-bundle.js',