* Add support for .amp.js pages and
resolving /page?amp=1 to page.amp.js
* Update amp tests
* Update example and clean up amp page resolving
* Add nested amp test
* page => normalizedPage
* Add type to page options
* Add handling of amp with all pageExtensions
and normalize page
* Make sure findPageFile only falls back to
amp if enabled
I noticed that the nodemon.json file was not watching for all file changes in the correct location for filetype .ts (typescript). After some research I found that the "ext" option in the nodemon.json fixes the issue and should work across all operating systems.
When overriding `config.resolve.alias` incorrectly webpack will throw an error because private-next-pages is not defined. This adds a more descriptive error explaining the error better.
Fixes: #6681
By default when `next export`ing a Next.js application we will automatically append a `/` to all urls to be fully compatible with the directory structure being output.
However since most platforms support directory indexes it makes sense to change this default in the future.
This PR adds `exportTrailingSlash` as experimental flag. We'll try this out for a bit on nextjs.org / zeit.co/docs before introducing it as new option.
The default value is `true` as this is the current behavior in stable Next.js.
```
{
experimental: {
exportTrailingSlash: false
}
}
```
⚠️ as with all experimental flags being added this is subject to breaking between canary/stable versions.
Replicates the behaviour of the `with-mobx` example but implemented using `mobx-react-lite` and React context.
I'm still working out a best practice regarding actions and welcome feedback on anything.
* Typecheck server vs. client code independently, ensuring that each respects its own tsconfig.
* Use nextjs default distDir in tsconfig
* Update packages
* Fix type error in server.listen callback
* Check for the user's home directory in the build output
* Output files on windows for debugging
* add process cwd
* try more paths
* Add branch for winblows
* Print info on error
* set proper env
* try fix
* Add a new field to webpack types
* Revert "Add a new field to webpack types"
This reverts commit d35fa02207fbfd0085da0fc56aac42c4ff7c34c9.
* Add HashedChunkIdsPlugin to make consistent chunk ids
* Revert "Revert "Add a new field to webpack types""
This reverts commit 338219049e1432038f90c91928b010bbb1267999.
* Make it optional
* Remove record ids
* Revert "Remove record ids"
This reverts commit 15c22dbcda72466c382397c91d02295620f62326.
* Show a better error when someone throws undefined
* Update error wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update error wording in test
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update test and add check for statusCode
before updating error
- Removed `fetchRoute` as it was only used once (internal method, non-breaking)
- Convert files to TypeScript
- Don't extend `ServerRouter` from `Router` as it introduces unneeded overhead, we only have to provide `pathname` `asPath` and `query` for `withRouter`. Also added `events` even though it shouldn't be called on SSR, just making sure we don't break things.
* Apply workaround for Firefox bug
and shallow routing
* Update to only apply workaround when needed
* Add TODO for future removal
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>