Created
May 16, 2018 11:56
-
-
Save fredericpfisterer/e4bcddeb8c1ee69ee9031bedaf140488 to your computer and use it in GitHub Desktop.
Wordplate Laravel Mix config file
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"); | |
require("dotenv").config(); | |
/* | |
|-------------------------------------------------------------------------- | |
| Mix Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Mix provides a clean, fluent API for defining some Webpack build steps | |
| for your Laravel application. By default, we are compiling the Sass | |
| file for your application, as well as bundling up your JS files. | |
| | |
*/ | |
const theme = process.env.WP_THEME; | |
mix.setResourceRoot("../"); | |
mix.setPublicPath(`public/themes/${theme}/assets`); | |
mix.js("resources/assets/scripts/app.js", "scripts"); | |
mix.sass("resources/assets/styles/app.scss", "styles"); | |
mix.browserSync({ | |
proxy: process.env.BROWSER_SYNC_PROXY, | |
files: [ | |
`public/themes/${theme}/**/*.php`, | |
`public/themes/${theme}/**/*.js`, | |
`public/themes/${theme}/**/*.css` | |
], | |
browser: "Google Chrome" | |
}); | |
mix.disableNotifications(); | |
if (!mix.inProduction()) { | |
mix.webpackConfig({ | |
devtool: 'source-map' | |
}) | |
.sourceMaps() | |
} | |
else{ | |
mix.version(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment