From a8b6694b0ab65ded158bcf089474e94fe593be93 Mon Sep 17 00:00:00 2001 From: Rajdeep Bharati Date: Wed, 24 Jul 2019 22:06:40 +0530 Subject: [PATCH] Configure webpack to load images. Import img files in app.module.js and configure webpack. Fixes https://github.com/buildbot/buildbot/issues/4880 --- www/base/src/app/app.module.js | 6 +++++- www/base/webpack.config.js | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/www/base/src/app/app.module.js b/www/base/src/app/app.module.js index e918966651d..5492b1cf72a 100644 --- a/www/base/src/app/app.module.js +++ b/www/base/src/app/app.module.js @@ -90,4 +90,8 @@ require('./workers/worker/worker.route.js'); require('./workers/workeraction.dialog.js'); require('./workers/workers.controller.js'); require('./workers/workers.route.js'); - +require('../img/favicon.ico'); +require('../img/icon.png'); +require('../img/icon.svg'); +require('../img/icon16.svg'); +require('../img/nobody.png'); diff --git a/www/base/webpack.config.js b/www/base/webpack.config.js index 4fc37c00723..f687409b17e 100644 --- a/www/base/webpack.config.js +++ b/www/base/webpack.config.js @@ -25,8 +25,17 @@ module.exports = function() { outputPath: outputPath, extractStyles: true, extraRules: [{ - test: /\.(ttf|eot|svg|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/, + test: /\.(ttf|eot|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: 'file-loader' + }, { + test: /\.(jp?eg|png|svg|ico)(\?v=[0-9]\.[0-9]\.[0-9])?$/, + use: [{ + loader: 'file-loader', + options: { + name: '[name].[ext]', + outputPath: 'img' + } + }] }], extraPlugins: [ new WebpackShellPlugin({