1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/test/integration
Oscar Busk 27c0b199d0 Fix paths when built on windows (#5795)
This PR Fixes #4920

So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules.

```
Error: Cannot find module '/user_code/next/server/bundles\pages\index.js
```

My simple solution is to modify the `pages-manifest.json` to always use linux separator (`/`), then also
modify `server/require.js` to, when requiring page, replace any separator (`\` or `/`) with current platform-specific file separator (`require('path').sep`).

The fix in `server/require.js` would be sufficient, but my opinion is that having some cross-platform consistency is nice.

This change was tested by bulding an application in windows and running it in linux and windows, aswell as building an application in linux and running it in linux and windows. The related tests was also run.
# Conflicts:
#	test/integration/production/test/index.test.js
2018-12-10 14:48:06 +01:00
..
app-aspath Fix linter (#5350) 2018-10-20 17:00:01 +02:00
app-document Add crossOrigin via props to _document Head and NextScript (#5646) 2018-11-13 21:36:09 +01:00
babel Fix linter (#5350) 2018-10-20 17:00:01 +02:00
basic Fix edge case where file had module.export in the content (#5823) 2018-12-05 14:37:26 +01:00
config Temporarily disable sass test 2018-11-29 19:23:00 +01:00
custom-server use native http instead of micro (#5706) 2018-11-19 16:36:18 +01:00
dist-dir Fix linter (#5350) 2018-10-20 17:00:01 +02:00
export fix: update correct path to use when exporting 404 page (#5470) 2018-11-03 01:19:41 +01:00
filesystempublicroutes use native http instead of micro (#5706) 2018-11-19 16:36:18 +01:00
lambdas Add tests for isomorphic-unfetch bundling issue (#5805) 2018-12-04 10:59:12 +01:00
ondemand Fix linter (#5350) 2018-10-20 17:00:01 +02:00
page-extensions Fix linter (#5350) 2018-10-20 17:00:01 +02:00
production Fix paths when built on windows (#5795) 2018-12-10 14:48:06 +01:00
production-config Add test for generateBuildId (#5816) 2018-12-04 16:42:25 +01:00
size-limit Use Typescript to transpile Next.js core files instead of Babel (#5747) 2018-11-28 15:03:02 +01:00
with-router Fix linter (#5350) 2018-10-20 17:00:01 +02:00