From 42b50f2e690bb40599ea0572b1e9e6ab38fed5e0 Mon Sep 17 00:00:00 2001 From: Rick Date: Tue, 23 Feb 2016 00:23:50 +0100 Subject: [PATCH] Add file-loader support for static assets in subdirectories. Log server-side Transmit errors. --- configs/webpack.client.js | 2 +- configs/webpack.server.js | 2 +- package.json | 2 +- src/server.js | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configs/webpack.client.js b/configs/webpack.client.js index 84fa545..9b4656d 100644 --- a/configs/webpack.client.js +++ b/configs/webpack.client.js @@ -23,7 +23,7 @@ module.exports = { module: { loaders: [ {test: /\.json$/, loaders: ["json"]}, - {test: /\.(ico|gif|png|jpg|jpeg|svg|webp|ttf|eot|woff|woff2)$/, loaders: ["file?name=/[name].[ext]"]} + {test: /\.(ico|gif|png|jpg|jpeg|svg|webp)$/, loaders: ["file?context=static&name=/[path][name].[ext]"]} ], postLoaders: [ {test: /\.js$/, loaders: ["babel?presets[]=es2015&presets[]=stage-0&presets[]=react"], exclude: /node_modules/} diff --git a/configs/webpack.server.js b/configs/webpack.server.js index 4cfbb5f..b87eb43 100644 --- a/configs/webpack.server.js +++ b/configs/webpack.server.js @@ -21,7 +21,7 @@ module.exports = { module: { loaders: [ {test: /\.json$/, loaders: ["json"]}, - {test: /\.(ico|gif|png|jpg|jpeg|svg|webp|ttf|eot|woff|woff2)$/, loaders: ["file?name=/[name].[ext]"]} + {test: /\.(ico|gif|png|jpg|jpeg|svg|webp)$/, loaders: ["file?context=static&name=/[path][name].[ext]"]} ], postLoaders: [ {test: /\.js$/, loaders: ["babel?presets[]=es2015&presets[]=stage-0&presets[]=react"], exclude: /node_modules/} diff --git a/package.json b/package.json index ce2ffe5..0a0e38b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-isomorphic-starterkit", "description": "Isomorphic starterkit with server-side React rendering.", - "version": "5.3.0", + "version": "5.3.1", "license": "BSD-3-Clause", "repository": { "type": "git", diff --git a/src/server.js b/src/server.js index 0a5e913..c171723 100644 --- a/src/server.js +++ b/src/server.js @@ -60,6 +60,8 @@ try { this.body = Transmit.injectIntoMarkup(template, reactData, [`${webserver}/dist/client.js`]); callback(null); + }).catch(e => { + callback(e); }); }); });