The steps below for the Default Webpack Package. If you want to use the Gulp, go to this Gulp Quick Start section.
-
Download the latest theme source from the marketplace.
-
Download and install Node.js from nodejs.org/en/download/
-
Start command prompt window or terminal and change directory to
[metronic]/theme/default/[demo]/tools/
cd theme/default/demo1/tools
-
Install the latest npm.
npm install --global npm@latest
-
Install yarn via the npm.
npm install --global yarn
Don't forget to run
yarn upgrade
after every Metronic updates released in order to install newly added or updated 3rd-party plugins.
Usenpm cache clean --force
command, if installation had failed at any step. Retry from start after it done. -
Install yarn dependencies. Must execute in
[metronic]/theme/default/[demo]/tools/
folder.yarn
-
This below command will compile all the assets(sass, js, media) and copy HTML templates to
[metronic]/theme/default/dist/
folder.npm run build
By default
dist
folder does not exist and it will be generated only after running the compile task.
Check on the detail Webpack documentation here for more information about the build options. -
To start Webpack in localhost, use this command to start the localhost server and can be used to quickly develop an application
npm run localhost
It will take a few seconds the browser will be automatically opened after the build finished and you will get a list of all available demos(e.g: demo1, demo2... demo12). Click your prefered demo for further preview.
Press
Ctrl+C
to quit from localhost.
For more information about the Webpack
build tool, click here.