Created
April 19, 2019 14:22
-
-
Save tcelestino/1e63f93cc4142ba6c27b291a567aed25 to your computer and use it in GitHub Desktop.
webpack file-loader settings to next.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const staticPrefix = '_next/static/'; | |
{ | |
test: /\.(eot|woff2?|ttf|svg|jpe?g|png|svg|gif|ico)$/, | |
use: [ | |
{ | |
loader: 'file-loader', | |
options: { | |
name: IS_PROD ? '' : '[path][name].[ext]', | |
publicPath: nextConf.assetPrefix.length | |
? `${nextConf.assetPrefix}${staticPrefix}` | |
: `/${staticPrefix}`, | |
outputPath: './static' | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment