1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fix JSON pages not building on Windows (#611)

* Check for .json file extension before JSON parse. Was throwing when reading js files.

* Fix cross platform regex

* Revert back to the original content in read-page.js
This commit is contained in:
Arunoda Susiripala 2017-01-01 20:06:49 -08:00 committed by GitHub
parent 43e2707e5d
commit 4b9f3fc431

View file

@ -3,7 +3,7 @@ export default class JsonPagesPlugin {
compiler.plugin('after-compile', (compilation, callback) => {
const pages = Object
.keys(compilation.assets)
.filter((filename) => /^bundles\/pages.*\.js$/.test(filename))
.filter((filename) => /^bundles[/\\]pages.*\.js$/.test(filename))
pages.forEach((pageName) => {
const page = compilation.assets[pageName]