【问题标题】:next js module.exports sass and static下一个 js module.exports sass 和 static
【发布时间】:2019-02-07 22:53:13
【问题描述】:

我试图弄清楚如何设置我的 next.config.js 文件以使用 sass 以及 exportPathMap,这就是我所拥有的:

module.exports = {
  withSass() {},
  exportPathMap: function() {
    return {
      '/': { page: '/' },
    };
  },
};

但是看起来 withSass() 没有运行,我需要用 withSass() 包装 exportPathMap 吗?

【问题讨论】:

    标签: webpack next.js


    【解决方案1】:

    我不知道exportPathMap 部分,但withSass 应该这样使用:(它是一个HoC)

    module.exports = withSass({
      exportPathMap: function() {
        return {
          '/': { page: '/' },
        };
      },
    });
    

    【讨论】:

    • 没有提到任何地方,非常有帮助。谢谢@Fabien Greard
    猜你喜欢
    • 2019-11-20
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 2017-08-06
    • 2015-05-09
    • 2022-06-24
    • 2018-04-05
    • 1970-01-01
    相关资源
    最近更新 更多