Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-multilingual

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-multilingual - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

4

lib/helpers/get-rewrites.d.ts
import type { Rewrite } from 'next/dist/lib/load-custom-routes';
/** Object representing a simplified version of the route manifest files. */
export declare type RoutesManifest = {
rewrites: Rewrite[];
};
/**

@@ -3,0 +7,0 @@ * Get the Next.js `Rewrite` objects directly from the build manifest.

@@ -18,3 +18,18 @@ "use strict";

return rewritesCache;
// Get the content from the Next.js build-manifest (.next/build-manifest.json).
// Try to get the content of the routes-manifest (.next/routes-manifest.json) first - this is only available on builds.
const routesManifestPath = (0, path_1.resolve)('.next', 'routes-manifest.json');
if ((0, fs_1.existsSync)(routesManifestPath)) {
const routesManifest = JSON.parse((0, fs_1.readFileSync)(routesManifestPath, 'utf8'));
const rewrites = routesManifest.rewrites.map((rewrite) => {
return {
source: rewrite.source,
destination: rewrite.destination,
locale: rewrite.locale,
};
});
// Save to the cache.
rewritesCache = rewrites;
return rewritesCache;
}
// If the server routes-manifest is not available, then get can get the rewrites from the client build manifest.
const buildManifestPath = (0, path_1.resolve)('.next', 'build-manifest.json');

@@ -21,0 +36,0 @@ const buildManifestContent = (0, fs_1.readFileSync)(buildManifestPath, 'utf8');

2

package.json
{
"name": "next-multilingual",
"description": "An opinionated end-to-end multilingual solution for Next.js.",
"version": "0.2.0",
"version": "0.3.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -5,2 +5,7 @@ # ![next-multilingual](./assets/next-multilingual-banner.svg)

Check out our [demo app](https://next-multilingual-example.avansai.com)!
[![Try me](https://img.shields.io/badge/-Try%20me!-green?style=for-the-badge)](https://next-multilingual-example.avansai.com)
## Installation 💻

@@ -7,0 +12,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc