commit 0cb05a46b272ac300032f464377d8c9b1e9e11eb
parent 9911e1d7b654d33a129bdb4da48c839368169b60
Author: Konstantin Tarkus <hello@tarkus.me>
Date: Tue, 2 Jun 2015 10:02:49 +0300
Update source maps settings in webpack.config.js
Ref #121
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/api/query.js b/src/api/query.js
@@ -3,7 +3,7 @@
import express from 'express';
import db from '../core/Database';
-const router = express.Router();
+const router = new express.Router();
router.get('/', async (req, res, next) => {
try {
diff --git a/src/server.js b/src/server.js
@@ -1,7 +1,5 @@
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
-require('source-map-support').install();
-
import 'babel/polyfill';
import _ from 'lodash';
import fs from 'fs';
diff --git a/webpack.config.js b/webpack.config.js
@@ -43,7 +43,6 @@ var config = {
cache: DEBUG,
debug: DEBUG,
- devtool: DEBUG ? '#inline-source-map' : false,
stats: {
colors: true,
@@ -111,6 +110,7 @@ var appConfig = _.merge({}, config, {
output: {
filename: 'app.js'
},
+ devtool: DEBUG ? 'source-map' : false,
plugins: config.plugins.concat([
new webpack.DefinePlugin(_.merge(GLOBALS, {'__SERVER__': false}))
].concat(DEBUG ? [] : [
@@ -141,8 +141,11 @@ var serverConfig = _.merge({}, config, {
__filename: false,
__dirname: false
},
+ devtool: DEBUG ? 'source-map' : 'cheap-module-source-map',
plugins: config.plugins.concat(
- new webpack.DefinePlugin(_.merge(GLOBALS, {'__SERVER__': true}))
+ new webpack.DefinePlugin(_.merge(GLOBALS, {'__SERVER__': true})),
+ new webpack.BannerPlugin('require("source-map-support").install();',
+ { raw: true, entryOnly: false })
),
module: {
loaders: config.module.loaders.map(function(loader) {