fond-of-spryker / assets-manifest
Use the Assets Manifest JSON File in Spryker for cache busting
Installs: 58 847
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- spryker/kernel: ^3.0.0
Requires (Dev)
- codeception/codeception: ^2.3
- mikey179/vfsstream: ^1.6
- phpro/grumphp: ^0.14
- sebastian/phpcpd: ^4.0
- spryker/code-sniffer: ^0.11
- spryker/development: ^3.6
This package is auto-updated.
Last update: 2024-10-16 21:18:37 UTC
README
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') }}