From 4dce74c506be20350406c8970048bbba2d81ad5b Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:12:10 +0700 Subject: [PATCH] fix: add webpack resolve alias, hoping it would fix can't resolve alias path --- next.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/next.config.js b/next.config.js index 7f0b705..8ca9368 100644 --- a/next.config.js +++ b/next.config.js @@ -1,9 +1,17 @@ /* eslint-disable */ +const path = require("path"); /** @type {import("next").NextConfig} */ const nextConfig = { reactStrictMode: true, pageExtensions: ["tsx", "ts"], + webpack: (config) => { + config.resolve.alias = { + ...config.resolve.alias, + "~": path.resolve(__dirname, "./"), + }; + return config; + }, }; module.exports = nextConfig;