Assets

All bundled assets are located in the folder starterkit/public/assets and you can include the static js, css and media files using Theme API helper functions.

Javascript

This is an example to add a single custom javascript file from the assets folder. The path is point to the assets folder.
theme.addJavascriptFile('js/custom/intro.js')

Css

This is an example to add a single custom css file from the assets folder.
theme.addCssFile('plugins/custom/cookiealert/cookiealert.bundle.css')

Vendors

Here is the example to add single vendor. Refer to _keenthemes/lib/themesettings.json file in vendors and you can find all available vendor names.
theme.addVendor('datatables')
This is an example to add multiple vendors.
theme.addVendors(['amcharts', 'amcharts-maps', 'amcharts-stock']);

Build assets

Before running the application we need to build theme assets:
  1. Start a command prompt window or terminal and change directory to starterkit/_keenthemes/tools
    cd starterkit/_keenthemes/tools
  2. Install dependencies with either one, yarn or npm:
    yarn install
    You can use either one.
    npm install
    This command will fetch all dependencies listed in starterkit/_keenthemes/tools/package.json and place them into _keenthemes/tools/node_modules folder.
  3. You can use Gulp  or Webpack  commands to bundle theme assets. The below command will compile all the assets(sass, js, media) to starterkit/public/assets folder:
    For gulp use command:
    gulp --demo1
    For webpack use command:
    npm run build --demo1
    Right now supported demos are demo1 and demo30.
    Note on the package.json file. This step is very important for Webpack in Metronic template. The default package.json works for Gulp. To make it work for Webpack, you have to modify tools/package.json and remove "type": "module". Otherwise, it will cause compilation error when running the build command.
Preview Get Help Buy Now