feat: set basePath via config
This commit is contained in:
committed by
Mathias Schopmans
parent
6dd5d5c017
commit
a9561a55b4
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"basePath": "/techradar",
|
||||||
"colors": {
|
"colors": {
|
||||||
"foreground": "#fff",
|
"foreground": "#fff",
|
||||||
"background": "#173d7a",
|
"background": "#173d7a",
|
||||||
|
|||||||
15
next.config.js
Normal file
15
next.config.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
const config = require("./data/config.json");
|
||||||
|
const basePath =
|
||||||
|
config.basePath && config.basePath !== "/" ? config.basePath : "";
|
||||||
|
|
||||||
|
/** @type {import("next").NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
|
basePath,
|
||||||
|
output: "export",
|
||||||
|
trailingSlash: true,
|
||||||
|
reactStrictMode: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = nextConfig;
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/** @type {import("next").NextConfig} */
|
|
||||||
const nextConfig = {
|
|
||||||
output: "export",
|
|
||||||
// basePath: "/techradar",
|
|
||||||
trailingSlash: true,
|
|
||||||
reactStrictMode: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default nextConfig;
|
|
||||||
@@ -6,7 +6,7 @@ import { markedHighlight } from "marked-highlight";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
import config from "../data/config.json";
|
import config from "../data/config.json";
|
||||||
import nextConfig from "../next.config.mjs";
|
import nextConfig from "../next.config.js";
|
||||||
import Positioner from "./positioner";
|
import Positioner from "./positioner";
|
||||||
|
|
||||||
import { Flag, Item } from "@/lib/types";
|
import { Flag, Item } from "@/lib/types";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from "clsx";
|
||||||
|
|
||||||
import config from "../../next.config.mjs";
|
import config from "../../next.config.js";
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return clsx(inputs);
|
return clsx(inputs);
|
||||||
|
|||||||
Reference in New Issue
Block a user