前端winter、杨村长、然叔Vue源码剖析
创建 next.config.js
栗子🌰:使用 file-loader 或者 next-images
// file-loader module.exports = {
webpack: (config, options) => {
config.module.rules.push({
test: /\.(jpg|png|gif|svg)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[contenthash].[ext]', // 文件名称
outputPath: 'static', // 硬盘路径
publicPath: '_next/static', // 网站路径
}
},
],