{"id":12614,"date":"2017-03-14T15:30:08","date_gmt":"2017-03-14T12:30:08","guid":{"rendered":"http:\/\/blog.belvg.com\/?p=12614"},"modified":"2025-07-03T08:57:12","modified_gmt":"2025-07-03T06:57:12","slug":"setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html","title":{"rendered":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7"},"content":{"rendered":"\n<p>In this article we are going to give a brief description how to modify your <em>webpack.config.js<\/em> file to enable hot module replacement.&nbsp;<!--more--><\/p>\n<p>First off, install all necessary dependencies:<\/p>\n<pre class=\"lang:php decode:true\">npm install --save-dev browser-sync webpack@1 webpack-dev-middleware webpack-hot-middleware monkey-hot-loader rimraf\r\n\/\/or\r\nyarn add -D browser-sync webpack@1 webpack-dev-middleware webpack-hot-middleware monkey-hot-loader rimraf<\/pre>\n<p>Once the installation is ready, create the file <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/hot.webpack.js#L1-L38\">hot.webpack.js<\/a> that will proxify our local server and will be reassembling the project in case any files are modified and will be updating those files in browser in real time.<\/p>\n<pre class=\"lang:php decode:true \">\/**\r\n&nbsp;* Require Browsersync along with webpack and middleware for it\r\n&nbsp;*\/\r\nlet browserSync&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = require('browser-sync').create();\r\nlet webpack&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = require('webpack');\r\nlet webpackDevMiddleware = require('webpack-dev-middleware');\r\nlet webpackHotMiddleware = require('webpack-hot-middleware');\r\nlet webpackConfig&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = require('.\/webpack.config.js');\r\n\/**\r\n&nbsp;* Require .\/webpack.config.js and make a bundler from it\r\n&nbsp;*\/\r\nconst bsPort = 3000;\r\nwebpackConfig.watch = false;\r\nwebpackConfig.output.publicPath = `http:\/\/localhost:${bsPort}\/ps\/themes\/classic\/assets\/js\/` \/\/ url to webpack output path\r\n\r\nlet bundler = webpack(webpackConfig);\r\n\/**\r\n&nbsp;* Run Browsersync and use middleware for Hot Module Replacement\r\n&nbsp;*\/\r\nbrowserSync.init({\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open: true\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , port: bsPort\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , proxy: {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; target: `http:\/\/localhost:88` \/\/host your local webserver\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , src: [`.\/templates\/**\/*.tpl`, `.\/modules\/**\/*.tpl`] \/\/ full page reload if .tpl file changed\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , middleware: [\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; webpackDevMiddleware( bundler, {\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ IMPORTANT: dev middleware can't access config, so we should\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ provide publicPath by ourselves\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; publicPath: webpackConfig.output.publicPath\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , stats: { colors: true , chunck : false}\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , hot: true\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } ),\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; webpackHotMiddleware( bundler )\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]\r\n});<\/pre>\n<p>&lsquo;browser-sync&rsquo; serves as a <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/hot.webpack.js#L24-L26\">connecting link to our local server<\/a> which has prestashop 1.7 and webpack with <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/hot.webpack.js#L28-L37\">webpack-dev-middleware and webpack-hot-middleware<\/a> installed.<\/p>\n<p>An important note:&nbsp; In the webpack config file you should specify <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/hot.webpack.js#L14\">output.publicPath<\/a>, &nbsp;indicate browser-sync server&rsquo;s host, port number and also disable <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/hot.webpack.js#L13\">watch = false<\/a>!<\/p>\n<p>A browser sends requests to browser-sync server and the server then redirects them to the middleware array. Then webpack-dev-middleware verifies the url of the query and publicPath. If they coincide webpack-dev-middleware searches memory for the file and forwards the file to the browser, otherwise forwards the request further to the local server.<\/p>\n<p><em>Note: webpack-dev-middleware does not save the project on the hard drive but keeps it in memory (<\/em>memory-fs<em>).<\/em><\/p>\n<p>BrowserSync also has its own wather: <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/hot.webpack.js#L27\">browserSync settings<\/a> let you configure a task to monitor *.tpl templates and reload page every time the templates are modified.<\/p>\n<p>Next you should modify <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js\">webpack.config.js<\/a>&nbsp;Create a <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js#L2\">&nbsp;HOT constant<\/a> which will provide compatibility with the default webpack. Add an <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js#L27-L32\">option<\/a> to disable ExtractTextPlugin&nbsp; when in &ldquo;hot mode&rdquo; because we do not need to collect all styles into a single .css file.<\/p>\n<pre class=\"lang:php decode:true \">&gt;  new ExtractTextPlugin(\r\n    path.join('..', 'css', 'theme.css')\r\n    ,{\r\n      disable: HOT \/\/ if hot enabled disable ExtractTextPlugin\r\n    }\r\n  )\r\n<\/pre>\n<p><a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js#L45-L55\">Modify entries <\/a>&nbsp;with the help of the addHOT&nbsp; function. We will be adding scripts that will provide interaction between browser and assembler into the project.<\/p>\n<pre class=\"lang:php decode:true \">let addHOT = (arr, disable) =&gt; {\r\n  if (HOT) {\r\n    arr.unshift('webpack\/hot\/dev-server', 'webpack-hot-middleware\/client');\r\n  }\r\n  return arr;\r\n};\r\n\/\/\/\r\nmodule.exports = {\r\n  entry: {\r\n    theme: addHOT(['.\/js\/theme.js'])\r\n  },\r\n\/\/\/\r\n<\/pre>\n<p>Add <a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js#L22-L24\">HotModuleReplacementPlugin<\/a><\/p>\n<pre class=\"lang:php decode:true \">if (HOT) {\r\n  plugins.push(new webpack.HotModuleReplacementPlugin())\r\n}\r\n<\/pre>\n<p><a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js#L64\">&nbsp;Add a new <\/a>&nbsp;<a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/blob\/master\/_dev\/webpack.config.js#L64\">loader<\/a> to all .js files &nbsp;: monkey-hot-loader<\/p>\n<pre class=\"lang:php decode:true \">module: {\r\n    loaders: [{\r\n      test: \/\\.js$\/,\r\n      exclude: \/node_modules\/,\r\n      loaders: (HOT? ['monkey-hot-loader','babel-loader']: ['babel-loader'])\r\n    }]}\r\n\/\/...\r\n<\/pre>\n<p>Everything is ready now, so let&rsquo;s run the assembler in &lsquo;hot mode&rsquo;:<\/p>\n<pre class=\"lang:php decode:true \">node .\/hot.webpack.js<\/pre>\n<p>Once started, the browser will launch our proxified web-server. If you open the developers console you will see how the browser communicates with the webpack module and updates all files in real time.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-12619 size-belvg-post-content\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/03\/123-850x302.jpg\" alt=\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\" width=\"850\" height=\"302\" title=\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\">The code provided in this article is also available in our test repository:&nbsp;<a href=\"https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/\">https:\/\/github.com\/retyui\/prestashop-1.7-webpack-hot-module-replacement\/<\/a><br>\nThis will help you better understand the concept of hot module replacement.<\/p>\n<p>&nbsp;<\/p>\n\n","protected":false},"excerpt":{"rendered":"In this article we are going to give a brief description how to modify your &#8230;","protected":false},"author":82,"featured_media":12623,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[15,520,461],"tags":[],"class_list":["post-12614","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-prestashop","category-prestashop-custom-development","category-prestashop-development","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this article we are going to give a brief description how to modify your webpack.config.js file to enable hot module replacement. First off, install all necessary dependencies:\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Andrey Litvin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#article\",\"name\":\"Hot Module Replacement for Webpack 1.x in Prestashop 1.7 | BelVG Blog\",\"headline\":\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/^322B1170CC684DDA57897EDF1C2A1335DF819EA35337309ADD^pimgpsh_fullsize_distr.jpg\",\"width\":770,\"height\":209,\"caption\":\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\"},\"datePublished\":\"2017-03-14T15:30:08+02:00\",\"dateModified\":\"2025-07-03T08:57:12+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":9,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#webpage\"},\"articleSection\":\"Prestashop, PrestaShop Custom Development, Prestashop Development, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop#listItem\",\"name\":\"Prestashop\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop#listItem\",\"position\":2,\"name\":\"Prestashop\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#listItem\",\"name\":\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#listItem\",\"position\":3,\"name\":\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop#listItem\",\"name\":\"Prestashop\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin\",\"name\":\"Andrey Litvin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Andrey Litvin\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html\",\"name\":\"Hot Module Replacement for Webpack 1.x in Prestashop 1.7 | BelVG Blog\",\"description\":\"In this article we are going to give a brief description how to modify your webpack.config.js file to enable hot module replacement. First off, install all necessary dependencies:\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/andrey-litvin#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/03\\\/^322B1170CC684DDA57897EDF1C2A1335DF819EA35337309ADD^pimgpsh_fullsize_distr.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html\\\/#mainImage\",\"width\":770,\"height\":209,\"caption\":\"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#mainImage\"},\"datePublished\":\"2017-03-14T15:30:08+02:00\",\"dateModified\":\"2025-07-03T08:57:12+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Hot Module Replacement for Webpack 1.x in Prestashop 1.7 | BelVG Blog","description":"In this article we are going to give a brief description how to modify your webpack.config.js file to enable hot module replacement. First off, install all necessary dependencies:","canonical_url":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#article","name":"Hot Module Replacement for Webpack 1.x in Prestashop 1.7 | BelVG Blog","headline":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7","author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/03\/^322B1170CC684DDA57897EDF1C2A1335DF819EA35337309ADD^pimgpsh_fullsize_distr.jpg","width":770,"height":209,"caption":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7"},"datePublished":"2017-03-14T15:30:08+02:00","dateModified":"2025-07-03T08:57:12+02:00","inLanguage":"en-US","commentCount":9,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#webpage"},"articleSection":"Prestashop, PrestaShop Custom Development, Prestashop Development, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/prestashop#listItem","name":"Prestashop"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/prestashop#listItem","position":2,"name":"Prestashop","item":"https:\/\/belvg.com\/blog\/category\/prestashop","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#listItem","name":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#listItem","position":3,"name":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/prestashop#listItem","name":"Prestashop"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author","url":"https:\/\/belvg.com\/blog\/author\/andrey-litvin","name":"Andrey Litvin","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/e1a6e3c80cb940fddb65016d94b015cd951b4a8a9cd7227565131f28ea95c7a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Andrey Litvin"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#webpage","url":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html","name":"Hot Module Replacement for Webpack 1.x in Prestashop 1.7 | BelVG Blog","description":"In this article we are going to give a brief description how to modify your webpack.config.js file to enable hot module replacement. First off, install all necessary dependencies:","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/andrey-litvin#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2017\/03\/^322B1170CC684DDA57897EDF1C2A1335DF819EA35337309ADD^pimgpsh_fullsize_distr.jpg","@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html\/#mainImage","width":770,"height":209,"caption":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html#mainImage"},"datePublished":"2017-03-14T15:30:08+02:00","dateModified":"2025-07-03T08:57:12+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"12614","title":"Hot Module Replacement for Webpack 1.x in Prestashop 1.7 | #site_title","description":"In this article we are going to give a brief description how to modify your webpack.config.js file to enable hot module replacement. First off, install all necessary dependencies:","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:21","updated":"2026-11-03 18:37:21"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/prestashop\" title=\"Prestashop\">Prestashop<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tSetting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Prestashop","link":"https:\/\/belvg.com\/blog\/category\/prestashop"},{"label":"Setting Up Hot Module Replacement for Webpack 1.x in Prestashop 1.7","link":"https:\/\/belvg.com\/blog\/setting-up-hot-module-replacement-for-webpack-1-x-in-prestashop-1-7.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/12614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=12614"}],"version-history":[{"count":2,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/12614\/revisions"}],"predecessor-version":[{"id":29861,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/12614\/revisions\/29861"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/12623"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=12614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=12614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=12614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}