前端winter、楊村長(zhǎng)、然叔Vue源碼剖析
創(chuàng)建 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', // 硬盤(pán)路徑
? ? ? ? ? ?publicPath: '_next/static', // 網(wǎng)站路徑
? ? ? ? ?}
? ? ? ?},
? ? ?],
標(biāo)簽: