laravel-mix-versionhash
Advanced tools
Comparing version 1.1.6 to 1.1.7
{ | ||
"license": "MIT", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"author": "ctf0", | ||
@@ -17,3 +17,4 @@ "name": "laravel-mix-versionhash", | ||
"peerDependecies": { | ||
"laravel-mix": "^2.0.0" | ||
"laravel-mix": "^2.0.0", | ||
"collect.js": "^4.12.8" | ||
}, | ||
@@ -20,0 +21,0 @@ "keywords": [ |
@@ -31,19 +31,1 @@ <h1 align="center"> | ||
| delimiter | string | `'.'` | the delimiter for filename and hash, <br> note that anything other than `. - _` will be removed | | ||
## Known Issues | ||
### Bug when combined with BrowserSync | ||
Currently **v1.1.1**, there's a bug which causes BrowserSync to not start | ||
after compiling the code. to get around that you can use `mix.versionHash()` like so | ||
```js | ||
// … | ||
if (mix.inProduction()) { | ||
require('laravel-mix-versionhash') | ||
mix.versionHash() | ||
} | ||
``` |
@@ -9,2 +9,3 @@ const laravel_mix = require('laravel-mix') | ||
const path = require('path') | ||
const collect = require('collect.js') | ||
const separator = '.' | ||
@@ -216,3 +217,6 @@ | ||
file.write(newJson) | ||
file.write(collect(newJson) | ||
.sortKeys() | ||
.all() | ||
) | ||
}) | ||
@@ -232,3 +236,3 @@ | ||
// hook into Mix's task collection to update file name hashes | ||
proxyMethod.before(Mix, 'addTask', (task) => { | ||
forIn(Mix.tasks, (task) => { | ||
if (task instanceof ConcatenateFilesTask) { | ||
@@ -235,0 +239,0 @@ proxyMethod.after(task, 'merge', () => { |
213
11995
31