Elixir versioning public path

前端 未结 3 2393
日久生厌
日久生厌 2021-02-15 07:46

I\'m trying to use Elixir\'s version() method with my \'public\' folder being public_html (instead of the default \'public\' method).

I version my css file, which produc

3条回答
  •  佛祖请我去吃肉
    2021-02-15 08:15

    You forgot to overwrite your publicDir folder in the gulpfile.js file, this points the build folder to the correct location which is used by elixir to determine the version hash.

    elixir.config.publicDir = 'public_html';
    

    After you did that you must overwrite your public_path in Laravel, the recommended way for Laravel 5 is to go to the index.php in your public folder:

    Underneath

    $app = require_once __DIR__.'/../bootstrap/app.php';
    

    Add

    // set the public path to this directory
    $app->bind('path.public', function() {
        return __DIR__;
    });
    

提交回复
热议问题