fond-of-spryker/assets-manifest

Use the Assets Manifest JSON File in Spryker for cache busting

1.1.1 2018-11-28 10:28 UTC

This package is auto-updated.

Last update: 2022-01-16 15:37:28 UTC


README

Build Status PHP from Travis config license

Use the Assets Manifest JSON File in Spryker for cache busting

Installation

composer require fond-of-spryker/assets-mannifest

1. Add the Package in the configuration file

// ---------- ASSETS MANIFEST
$config[AssetsManifestConstants::PACKAGE] = 'default';

2. Add neccessary npm package in the package.json and install the package

 "webpack-assets-manifest"

3. trigger the console command to build yves

vendor/bin/console frontend:yves:build

4. add the webpack-assets-manifest package in the webpack configuration file "development.js"

  const WebpackAssetsManifest = require('webpack-assets-manifest');
  
  new WebpackAssetsManifest({
        publicPath: true
    })
    

5. Add twig service provider to YvesBootstrap.php in registerServiceProviders()

$this->application->register(new AssetsManifestTwigServiceProvider());

6. Add the Twig Extension in the neccessary Twig Templates

  {{ assetsManifest('app.js') }}