webpack: Add support for png file imports in file-loader.

Adds support for importing png files using file-loader in webpack.
Changes the name of the output directory to be files instead of
fonts for better readability.
This commit is contained in:
Armaan Ahluwalia 2018-05-02 01:57:05 +05:30 committed by Tim Abbott
parent fce6882eb9
commit 9f80418d12
1 changed files with 2 additions and 2 deletions

View File

@ -114,12 +114,12 @@ export default (env?: string) : webpack.Configuration => {
},
// load fonts and files
{
test: /\.(woff(2)?|ttf|eot|svg|otf)(\?v=\d+\.\d+\.\d+)?$/,
test: /\.(woff(2)?|ttf|eot|svg|otf|png)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
outputPath: 'files/'
}
}]
}