1、 安装依赖
yarn add @zeit/next-css
2、 根目录下创建 next.config.js
,内容如下
/* eslint-disable */
const withCss = require('@zeit/next-css');
// fix: prevents error when .css files are required by node
if (typeof require !== 'undefined') {
require.extensions['.css'] = (file) => {}
}
module.exports = withCss();