π PrestaShop Classic Theme Example hot module replacement, webpack.config.js - for webpack 3.x version.
Based on Prestashop 1.7.2.4
- Clone theme
classic-demo-hot
to you/themes/
folder. - Open in admin panel
Theme & Logo -> Theme
- Select
classic-demo-hot
theme - Open in admin panel
Advanced Parameters -> Performance
- Set
SMARTY -> Cache
: NO and Save! - done
Open /themes/classic-demo-hot/_dev/_webpack/util.js
and check all commented properties
# go to _dev folder
cd /themes/classic-demo-hot/_dev/
# install dependencies
yarn # or npm i
# run webpack in watch mode
yarn watch # or npm run watch
# open http://localhost:3000/ and check result
webpack@2
=> webpack@3
babel-loader@6
=> babel-loader@7
extract-text-webpack-plugin@2
=> extract-text-webpack-plugin@3
yarn add -D webpack@3 extract-text-webpack-plugin@3 babel-loader@7
Webserver for proxy your php backend.
Browser-sync plugin for injecting HTML changes without reloading the browser.
A development middleware for webpack read more...
Webpack hot reloading you can attach to your own server read mode...
It helps to conveniently configure types of configs (default / production / development)
##### Install
# Required
yarn add -D browser-sync-dev-hot-webpack-plugin browser-sync@2 bs-html-injector@3
yarn add -D webpack-dev-middleware@2 webpack-hot-middleware@2 webpack-merge cross-env
# Optional
yarn add -D babel-core@6 webpack-bundle-analyzer hard-source-webpack-plugin node-object-hash del
Added multi config which is combined depending on NODE_ENV
Updated scripts in package.json
Example Hot Module Replacement for Webpack 1.x
Prestashop 1.7
Example Hot Module Replacement for Webpack 2.x
Prestashop 1.7