rmariuzzo / Laravel-JS-Localization

🌐 Convert your Laravel messages and consume them in the front-end!

Home Page:https://github.com/rmariuzzo/laravel-js-localization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider updating README with Laravel 5.4 lang file generation steps

jjdrake opened this issue · comments

I'm currently working with Laravel 5.4 which uses the new Laravel Mix package by default and removes support for Gulp/Elixir. In order to generate the language file automatically during asset compilation I took the following steps:

  1. Add "webpack-shell-plugin" (I'm currently using version "0.3.5") to package.json's "devDependencies" section.

  2. Add the following to webpack.mix.js:

const WebpackShellPlugin = require('webpack-shell-plugin');

// Add shell command plugin configured to create JavaScript language file
mix.webpackConfig({
	plugins:
	[
		new WebpackShellPlugin({onBuildStart:['php artisan lang:js --quiet'], onBuildEnd:[]})
	]
});

Awesome @jjdrake! Can you create PR adding this?

@rmariuzzo Should this issue be closed, since it looks like #95 addresses this?

Good point @Iamchristopher! Thank you!