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 c867b0ce9c 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.
2018-12-10 12:14:29 +01:00
..
app-aspath Fix Typescript HMR (#4689) 2018-06-28 20:07:41 +02:00
app-document Factor out NextScript inline source (#4934) (#4939) 2018-08-14 11:05:25 -07:00
babel Fix Typescript HMR (#4689) 2018-06-28 20:07:41 +02:00
basic Make sure dynamicIds are added when using function as importer (#5308) 2018-09-27 16:40:54 +02:00
config Even more reliable error-recovery tests (#5284) 2018-09-26 01:04:15 +02:00
custom-server Upgrade standard.js (#4064) 2018-03-27 20:11:03 +02:00
dist-dir Clean up references to this.dir and this.dist everywhere (#4535) 2018-06-04 15:45:39 +02:00
export Use getBrowserBodyText for HMR test (#5290) 2018-09-26 01:41:39 +02:00
filesystempublicroutes Make exportPathMap / _next routes work with useFileSystemPublicRoutes disabled (#5131) 2018-09-09 22:32:23 +02:00
ondemand Even more reliable error-recovery tests (#5284) 2018-09-26 01:04:15 +02:00
page-extensions Fix Typescript HMR (#4689) 2018-06-28 20:07:41 +02:00
production Fix paths when built on windows (#5795) 2018-12-10 12:14:29 +01:00
production-config Trigger page register when module is executed (#5115) 2018-09-11 20:03:20 +02:00
with-router Run method sorting codemod (#4909) 2018-08-06 20:53:06 -07:00