Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mix + custom API for separate builds
const mix = require("laravel-mix")
mix.site = (id, callback) => {
if (!process.env.SITE || process.env.SITE === id) {
return callback()
}
};
mix.site('admin', () => {
mix.js("resources/js/admin/app.js", "public/js/admin.js")
mix.sass("resources/sass/admin/app.scss", "public/css/admin.css")
})
mix.site('app', () => {
mix.js("resources/js/app.js", "public/js")
mix.sass("resources/sass/app.scss", "public/css/app.css")
})
// run using:
// SITE=admin yarn run dev
// SITE=app yarn run dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.