Skip to content

Commit c0cd538

Browse files
committed
Adding an exception for manifest.json when loading as json, fixes facebook#558
1 parent a53da22 commit c0cd538

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

config/webpack.config.dev.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,18 @@ module.exports = {
119119
// allow it implicitly so we also enable it.
120120
{
121121
test: /\.json$/,
122+
exclude: /\/manifest.json$/,
122123
loader: 'json'
123124
},
125+
// A special case for manifest.json to place it into build root directory.
126+
{
127+
test: /\/manifest.json$/,
128+
include: [paths.appSrc],
129+
loader: 'file',
130+
query: {
131+
name: 'manifest.json?[hash:8]'
132+
}
133+
},
124134
// "file" loader makes sure those assets get served by WebpackDevServer.
125135
// When you `import` an asset, you get its (virtual) filename.
126136
// In production, they would get copied to the `build` folder.

config/webpack.config.prod.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,18 @@ module.exports = {
130130
// allow it implicitly so we also enable it.
131131
{
132132
test: /\.json$/,
133+
exclude: /\/manifest.json$/,
133134
loader: 'json'
134135
},
136+
// A special case for manifest.json to place it into build root directory.
137+
{
138+
test: /\/manifest.json$/,
139+
include: [paths.appSrc],
140+
loader: 'file',
141+
query: {
142+
name: 'manifest.json?[hash:8]'
143+
}
144+
},
135145
// "file" loader makes sure those assets end up in the `build` folder.
136146
// When you `import` an asset, you get its filename.
137147
{

0 commit comments

Comments
 (0)