diff --git a/AssetManifestTags.php b/AssetManifestTags.php index a501033..945b6c0 100755 --- a/AssetManifestTags.php +++ b/AssetManifestTags.php @@ -9,7 +9,7 @@ class AssetManifestTags extends Tags use AssetManifestTrait; /** - * The {{ laravel_mix }} tag - outputs the revision manifest file as JSON. + * The {{ asset_manifest }} tag - outputs the revision manifest file as JSON. * * @return string */ @@ -19,7 +19,7 @@ public function index() } /** - * The {{ laravel_mix:css }} tag - outputs the URL or tag for the theme's main CSS file. + * The {{ asset_manifest:css }} tag - outputs the URL or tag for the theme's main CSS file. * * @return string */ @@ -35,7 +35,7 @@ public function css() } /** - * The {{ laravel_mix:js }} tag - outputs the URL or tag for the theme's main JS file. + * The {{ asset_manifest:js }} tag - outputs the URL or tag for the theme's main JS file. * * @return string */ diff --git a/AssetManifestTrait.php b/AssetManifestTrait.php index 2f6382b..1c6a229 100755 --- a/AssetManifestTrait.php +++ b/AssetManifestTrait.php @@ -31,8 +31,7 @@ public function getAssetPath($type) $src = $this->get('src', Config::get('theming.theme')); $path = '/' . $type . '/' . Str::ensureRight($src, '.' . $type); $manifest = $this->getManifest()->get($path); - - return $this->themeUrl($manifest); + return $this->themeUrl($manifest ? $manifest : $path); } /** diff --git a/README.md b/README.md index 4badee4..0d06c13 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ A manifest file looks like that: This addon will not generate this manifest for you, it will just replace your assets. To generate this file you should use a build tool like Gulp, Grunt, Webpack, NPM scripts or whatever. +**If no manifest file was found it will simply load the files without hashes.** + ## Importing specific files The `asset_manifest` tag works exactly like the `theme` tag. So e.g. `{{ asset_manifest:css }}` will import `/css/default.css` and `{{ asset_manifest:css src="test" }}` will import `/css/test.css`.