Skip to content

Commit

Permalink
(OK) fixes webpack alias to be relative to node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jeantil committed May 26, 2020
1 parent ca6fcdb commit 047c685
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/web-app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@
// https://www.npmjs.com/package/next-transpile-modules
const withTM = require("next-transpile-modules")(["bar"]);

const path = require("path");

const nextConfig = {
webpack: function (config) {
/*
Optionnaly, adding the following to modules
will resolve modules using relative paths instead of
going through `<rootDir>/node_modules`
*/
/*
config.resolve.modules = [
path.join(__dirname, ".."),
...config.resolve.modules,
];
*/
config.resolve.alias = {
...config.resolve.alias,
baz: "../baz/src",
baz: "baz/src",
};

return config;
Expand Down

0 comments on commit 047c685

Please sign in to comment.