Skip to content

Commit b23b2c1

Browse files
authored
Merge pull request #95 from jjdrake/jjdrake-patch-1
Update readme with Laravel Mix info
2 parents bd651e0 + c027920 commit b23b2c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ elixir(function(mix) {
127127
});
128128
```
129129

130+
#### Using [Laravel's Mix](https://laravel.com/docs/5.4/mix) with Laravel 5.4+ (optional)
131+
132+
Add "[webpack-shell-plugin](https://www.npmjs.com/package/webpack-shell-plugin)" to package.json's "devDependencies" section.
133+
134+
Add the following to webpack.mix.js:
135+
136+
```js
137+
const WebpackShellPlugin = require('webpack-shell-plugin');
138+
139+
// Add shell command plugin configured to create JavaScript language file
140+
mix.webpackConfig({
141+
plugins:
142+
[
143+
new WebpackShellPlugin({onBuildStart:['php artisan lang:js --quiet'], onBuildEnd:[]})
144+
]
145+
});
146+
```
147+
130148
## Documentation
131149

132150
This is a quick documentation regarding [Lang.js](https://github.com/rmariuzzo/lang.js) (the thin JavaScript library included by `Laravel-JS-Localization`). The [Lang.js](https://github.com/rmariuzzo/lang.js) (a thin library highly inspired on Laravel's [`Translator`](https://laravel.com/api/5.3/Illuminate/Translation/Translator.html) class).

0 commit comments

Comments
 (0)