要么將所有CSS導(dǎo)入放在_app.tsx中,要么將*.module.css添加到文件名中,這樣它們就可以被拾取。 您還可以覆蓋nextjs網(wǎng)頁包配置: // next.config.jsmodule.exports = { webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { return config },}...{ test: /\.s?[ac]ss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: [/node_modules/],}, 為了覆蓋模塊規(guī)則和css加載程序,如果您不知道自己在做什么,我不建議您這樣做。