Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use mix.version() #3

Open
hfalucas opened this issue May 16, 2018 · 1 comment
Open

How to use mix.version() #3

hfalucas opened this issue May 16, 2018 · 1 comment

Comments

@hfalucas
Copy link

Is it possible to use the versioning option with this package? I have tried but the mix-manifest.json only gets the paths of the last npm mix executed command.

@thijsvdanker
Copy link

It is.
I am using this to build a seperate css file and mix file for each theme in resources/assets/sass/:

mix.sass(`resources/assets/sass/${MIX_PACKAGE}.scss`, `css`)
    .setPublicPath(`public/${MIX_PACKAGE}`)
    .sourceMaps()
    .disableNotifications();

if (mix.inProduction) {
  mix.version();
}

and run it using

npm run mix production footheme

This builds the files /public/footheme/css/footheme.css and and /public/footheme/mix-manifest.json

It is important to include the folder for the mix-manifest.json file in the mix() function in your php / blade file.

e.g.:

<link href="{{ mix('footheme.css', 'footheme') }}" rel="stylesheet">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants