Created
September 24, 2020 13:02
-
-
Save thecrypticace/52b5e54c74bd53077a058ba1cb958d9b to your computer and use it in GitHub Desktop.
Mix + custom API for separate builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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