From c0cd5386d885cb24f521a03a260289c6318c0432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Vor=C4=8D=C3=A1k?= Date: Sat, 3 Sep 2016 14:45:55 +0200 Subject: [PATCH 1/3] Adding an exception for manifest.json when loading as json, fixes #558 --- config/webpack.config.dev.js | 10 ++++++++++ config/webpack.config.prod.js | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 3a97767e1fc..170b73270c1 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -119,8 +119,18 @@ module.exports = { // allow it implicitly so we also enable it. { test: /\.json$/, + exclude: /\/manifest.json$/, loader: 'json' }, + // A special case for manifest.json to place it into build root directory. + { + test: /\/manifest.json$/, + include: [paths.appSrc], + loader: 'file', + query: { + name: 'manifest.json?[hash:8]' + } + }, // "file" loader makes sure those assets get served by WebpackDevServer. // When you `import` an asset, you get its (virtual) filename. // In production, they would get copied to the `build` folder. diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index af9d35df408..7be253feb90 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -130,8 +130,18 @@ module.exports = { // allow it implicitly so we also enable it. { test: /\.json$/, + exclude: /\/manifest.json$/, loader: 'json' }, + // A special case for manifest.json to place it into build root directory. + { + test: /\/manifest.json$/, + include: [paths.appSrc], + loader: 'file', + query: { + name: 'manifest.json?[hash:8]' + } + }, // "file" loader makes sure those assets end up in the `build` folder. // When you `import` an asset, you get its filename. { From 5e161d012fc5e413c98077f1a918955bde9e8d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Vor=C4=8D=C3=A1k?= Date: Sun, 4 Sep 2016 19:12:20 +0200 Subject: [PATCH 2/3] Removed appSrc from include confition --- config/webpack.config.dev.js | 5 ++--- config/webpack.config.prod.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 170b73270c1..367a07f8fc1 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -119,13 +119,12 @@ module.exports = { // allow it implicitly so we also enable it. { test: /\.json$/, - exclude: /\/manifest.json$/, + exclude: /\/manifest\.json$/, loader: 'json' }, // A special case for manifest.json to place it into build root directory. { - test: /\/manifest.json$/, - include: [paths.appSrc], + test: /\/manifest\.json$/, loader: 'file', query: { name: 'manifest.json?[hash:8]' diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 7be253feb90..b468560a139 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -130,13 +130,12 @@ module.exports = { // allow it implicitly so we also enable it. { test: /\.json$/, - exclude: /\/manifest.json$/, + exclude: /\/manifest\.json$/, loader: 'json' }, // A special case for manifest.json to place it into build root directory. { - test: /\/manifest.json$/, - include: [paths.appSrc], + test: /\/manifest\.json$/, loader: 'file', query: { name: 'manifest.json?[hash:8]' From 61b2a1f2e19ca0b5c9ef6f11ffb7362a088fb945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Vor=C4=8D=C3=A1k?= Date: Sun, 4 Sep 2016 19:13:22 +0200 Subject: [PATCH 3/3] Fix favicon.ico regexp --- config/webpack.config.dev.js | 4 ++-- config/webpack.config.prod.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 367a07f8fc1..a7e8ca6aaec 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -135,7 +135,7 @@ module.exports = { // In production, they would get copied to the `build` folder. { test: /\.(ico|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/, - exclude: /\/favicon.ico$/, + exclude: /\/favicon\.ico$/, loader: 'file', query: { name: 'static/media/[name].[hash:8].[ext]' @@ -143,7 +143,7 @@ module.exports = { }, // A special case for favicon.ico to place it into build root directory. { - test: /\/favicon.ico$/, + test: /\/favicon\.ico$/, include: [paths.appSrc], loader: 'file', query: { diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index b468560a139..f2536403e8c 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -145,7 +145,7 @@ module.exports = { // When you `import` an asset, you get its filename. { test: /\.(ico|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/, - exclude: /\/favicon.ico$/, + exclude: /\/favicon\.ico$/, loader: 'file', query: { name: 'static/media/[name].[hash:8].[ext]' @@ -153,7 +153,7 @@ module.exports = { }, // A special case for favicon.ico to place it into build root directory. { - test: /\/favicon.ico$/, + test: /\/favicon\.ico$/, include: [paths.appSrc], loader: 'file', query: {