About Webpack in Prestashop 1.7

Jan 25, 2018393Denis Kulikouski
About Webpack in Prestashop 1.7

Webpack is a module bundler which takes modules with dependencies and generates static assets that represent those modules. In order to use Webpack in Prestashop 1.7, you need to carry out the following actions:

1. Download and install Node.js:

  • Win or MacOS: download the installer from the website nodejs.org.
  • Debian and Ubuntu:

2. In the directory in Prestashop go to the _dev folder.
3. Perform in the command line: npm install
4. Then you have a choice:

  • To build your assets, enter npm run build  
  • To rebuild assets every time when the file is changed in the /themes/%themename%/_dev/ folder, enter npm run watch  

The Webpack configuration file for StarterTheme:

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *