Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Advanced Laravel Mix setup for WordPlate - https://github.com/wordplate/wordplate
const mix = require('laravel-mix').mix;
const resources = 'resources/assets';
const themePath = 'public/themes/wordplate';
const assetsPath = `${themePath}/assets`;
mix.setPublicPath(assetsPath);
mix.setResourceRoot('../');
mix.browserSync({
proxy: 'wordplate.dev',
files: [
`${themePath}/**/*.php`,
`${assetsPath}/**/*.js`,
`${assetsPath}/**/*.css`
]
});
mix.js(`${resources}/scripts/app.js`, `${assetsPath}/scripts`);
mix.sass(`${resources}/styles/app.scss`, `${assetsPath}/styles`, {
includePaths: ['node_modules']
});
mix.sass(`${resources}/styles/editor-style.scss`, `${assetsPath}/styles`, {
includePaths: ['node_modules']
});
// Hash and version files in production.
if (mix.config.inProduction) {
mix.version();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment