mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-01 06:15:06 +03:00
65 lines
1.1 KiB
JavaScript
65 lines
1.1 KiB
JavaScript
const mix = require('laravel-mix');
|
|
|
|
// Public path helper
|
|
const publicPath = (path) => `${mix.config.publicPath}/${path}`;
|
|
|
|
// Source path helper
|
|
const src = (path) => `./${path}`;
|
|
|
|
// Public Path
|
|
mix
|
|
.setPublicPath('./dist')
|
|
.setResourceRoot('/')
|
|
.webpackConfig({
|
|
output: { publicPath: mix.config.resourceRoot },
|
|
});
|
|
|
|
// Browsersync
|
|
mix.browserSync('example.test');
|
|
|
|
// CoffeeScript
|
|
mix.webpackConfig({
|
|
module: {
|
|
rules:[
|
|
{
|
|
test: /\.coffee$/,
|
|
loader: 'coffee-loader'
|
|
}
|
|
]
|
|
}
|
|
});
|
|
|
|
// Styles
|
|
mix.sass(src`sass/main.scss`, 'styles')
|
|
.options({
|
|
processCssUrls: false,
|
|
})
|
|
.extract();
|
|
|
|
// JavaScript
|
|
mix.js('game/story.coffee', 'game')
|
|
.extract(); // extract vendor libraries
|
|
|
|
// Assets
|
|
// mix.copyDirectory(src`images`, publicPath`images`);
|
|
// mix.copyDirectory(src`fonts`, publicPath`fonts`);
|
|
mix.copyDirectory(src`html`, publicPath``);
|
|
|
|
// Autoload
|
|
/*
|
|
mix.autoload({
|
|
jquery: ['$', 'window.jQuery'],
|
|
});
|
|
*/
|
|
|
|
// Options
|
|
mix.options({
|
|
processCssUrls: false,
|
|
});
|
|
|
|
// Source maps when not in production.
|
|
mix.sourceMaps(false, 'source-map');
|
|
|
|
// Hash and version files in production.
|
|
// mix.version();
|