Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
/ webpack Public archive

πŸ“¦ A plugin for Craft CMS to load hashed Webpack filenames from a manifest.json file.

License

Notifications You must be signed in to change notification settings

craftplugins/webpack

Repository files navigation

Important

This plugin is no longer maintained.

We recommend using the Twigpack plugin instead.

Webpack plugin for Craft CMS

Craft CMS plugin to help extract hashed Webpack filenames from a manifest.json file.

Webpack works on Craft 2.4.x and Craft 2.5.x.

Webpack Overview

Built to work with webpack-manifest-plugin.

This plugin expects a key/value JSON manifest file with content similar to that shown below.

{
 "mods/alpha.js": "mods/alpha.1234567890.js",
 "mods/omega.js": "mods/omega.0987654321.js"
}

Configuring Webpack

Add a webpack.php to your config directory.

/**
 * The path to the manifest.json file.
 *
 * @var string
 */
'path' => CRAFT_BASE_PATH.'../public/assets/manifest.json',
/**
 * A string to prepend to filenames.
 *
 * @var string
 */
'prefix' => '/assets/',

Using Webpack

<html>
 <head>
 <link rel="stylesheet" href="{{ craft.webpack.getFilename('main.css') }}">
 </head>
 <body>
 <script src="{{ craft.webpack.getFilename('main.js') }}"></script>
 </body>
</html>

About

πŸ“¦ A plugin for Craft CMS to load hashed Webpack filenames from a manifest.json file.

Topics

Resources

License

Stars

Watchers

Forks

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /