使用项目相对路径import 模块包的方法
-
在next.config.js里加入:
const path = require("path"); ... config.resolve.modules.push(path.resolve("./")); return config;
其他方法:https://whoisryosuke.com/blog/2018/nextjs-tip-relative-es6-modules/
在next.config.js里加入:
const path = require("path");
...
config.resolve.modules.push(path.resolve("./"));
return config;
其他方法:https://whoisryosuke.com/blog/2018/nextjs-tip-relative-es6-modules/