Skip to content

globally/static config eg set default path? #2

@codemonkeynorth

Description

@codemonkeynorth

Hi,

it'd be useful to be able to globally set the path to something other than build so it doesn't need to be called every time I call mix

I will probably be using it a lot in my templates, but my files are in dist, so ideally I could configure this in my bootstrap functions

<script src="{{ mix('js/app.js') }}"></script>
<link rel="stylesheet" href="{{ mix('css/app.css')" />

also it would be good if you could namespace your class/methods to Mindkomm maybe?

anyway in the meantime I've done it like this (adding the namespace to your file):

public function add_to_twig( $twig ) {
    $twig->addFunction( new \Timber\Twig_Function( 'mix', [$this, 'mix']));
    return $twig;
}

public function mix($path) {
    return \Mindkomm\mix($path, ['manifest_directory' => 'dist']);
}

hope that's useful to somebody.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions