From ed7a52a274c6a9da60653d96b3d003b62099d4d5 Mon Sep 17 00:00:00 2001 From: Jean Helou Date: Fri, 29 May 2020 12:00:40 +0200 Subject: [PATCH] (OK) with https://github.com/vercel/next.js/pull/13542 if https://github.com/vercel/next.js/pull/13542 is merged, most of the yarn workspace + typescript config will be picked up automatically, removing the need for next-transpile-modules --- packages/web-app/next.config.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/web-app/next.config.js b/packages/web-app/next.config.js index d310ddf..ba84f55 100644 --- a/packages/web-app/next.config.js +++ b/packages/web-app/next.config.js @@ -1,18 +1,29 @@ // Tell webpack to compile the "bar" package, necessary if you're using the export statement for example // https://www.npmjs.com/package/next-transpile-modules -const withTM = require("next-transpile-modules")(["bar"]); +//const withTM = require("next-transpile-modules")(["bar"]); const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); const nextConfig = { webpack: function (config) { + /* + Optionnaly, adding the following to modules + will resolve modules using relative paths instead of + going through `/node_modules` + */ + /* + config.resolve.modules = [ + path.join(__dirname, ".."), + ...config.resolve.modules, + ]; + */ config.resolve.plugins = [ ...config.resolve.plugins, new TsconfigPathsPlugin(), ]; - return config; }, }; -module.exports = withTM(nextConfig); +//module.exports = withTM(nextConfig); +module.exports = nextConfig;