-
Notifications
You must be signed in to change notification settings - Fork 113
11. Laravel Mix Workflow
Giannis Gasteratos edited this page Nov 19, 2017
·
1 revision
You are free to integrate your prefered workflow when developing your themes.
This is a proposed setup for Laravel Mix:
- Put your css/js etc of each theme on the same folder with my views (you can pick any location as long as they are not in the public folder. eg resources/assets/ThemeName)
- Setup Laravel Mix to compile these files and save the compiled files inside each Themes's asset folder (inside the public folder so that they can be served)
- In your views include the compiled js/css files (like any other asset).
As you can see Laravel Mix (Steps 1+2 = Development) doesn't interfere with the Package itself (Step 3 = Runtime)
This is an example webpack.js
configuration:
// ThemeA assets
mix.js('resources/views/ThemeA/js/app.js', 'public/ThemeA/js')
.sass('resources/views/ThemeA/sass/app.scss', 'public/ThemeA/css');
// ThemeB assets
mix.js('resources/views/ThemeB/js/app.js', 'public/ThemeB/js')
.sass('resources/views/ThemeB/sass/app.scss', 'public/ThemeB/css');