I want to run webpack in angular application so I wrote the code like this .
package.json file
"scripts": {
"start_ar": "ng build --watch --configuration=dev_ar",
},
"devDependencies": {
"@angular-builders/custom-webpack": "^7.1.4",
"file-loader": "^1.1.11",
"html-loader": "^0.5.5",
"url-loader": "^1.0.1"
}
In angular.json file
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js",
"replaceDuplicatePlugins": true
},
In webpack.config.js
module.exports = {
module : {
rules: [
{
"test": /\.(jpg|png|webp|gif|otf|ani|ico|cur)$/,
"loader": "url-loader",
"options": {
"name": "[name].[hash:7].[ext]",
"limit": 10000,
"outputPath": "../assets/img/",
"publicPath": "src/assets/img/"
}
}]}};
But the problem is that the image still as is , like that the webpack dose not run , I have no error but I didn't see any change to the image , Is there anything missing in this code ??