diff --git a/content/utils.ts b/content/utils.ts index fb90e172a930..3ec735e266c4 100644 --- a/content/utils.ts +++ b/content/utils.ts @@ -1,8 +1,6 @@ import path from "path"; import childProcess from "child_process"; - import LRU from "lru-cache"; -import prettier from "prettier"; import { CONTENT_ROOT, CONTENT_TRANSLATED_ROOT } from "../libs/env"; import { slugToFolder as _slugToFolder } from "../libs/slug-utils"; @@ -107,7 +105,8 @@ export function execGit(args, opts: { cwd?: string } = {}, root = null) { export function toPrettyJSON(value) { const json = JSON.stringify(value, null, 2) + "\n"; try { - return prettier.format(json, { parser: "json" }); + // eslint-disable-next-line n/no-unpublished-require + return require("prettier").format(json, { parser: "json" }); } catch (e) { return json; } diff --git a/server/dev.ts b/server/dev.ts index f4a34dfbb120..687392763430 100644 --- a/server/dev.ts +++ b/server/dev.ts @@ -1,11 +1,13 @@ -import webpack from "webpack"; -import webpackDevMiddleware from "webpack-dev-middleware"; -import webpackHotMiddleware from "webpack-hot-middleware"; -import { WebpackConfiguration } from "webpack-dev-server"; +import type { WebpackConfiguration } from "webpack-dev-server"; export const devMiddlewares = []; if (process.env.NODE_ENV === "development") { + /* eslint-disable n/no-unpublished-require */ + const webpack = require("webpack"); + const webpackDevMiddleware = require("webpack-dev-middleware"); + const webpackHotMiddleware = require("webpack-hot-middleware"); + const webpackConfig: WebpackConfiguration = { entry: { app: [