datasafer-laravel
Version:
Extensão do sitema de frontend para o Laravel Mix
51 lines (45 loc) • 1.55 kB
JavaScript
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Arquivo de configuração do mix para os projetos Datasafer
|
*/
module.exports = function(mix, app_url) {
// mix.webpackConfig(webpack => {
// return {
// plugins: [
// new webpack.ProvidePlugin({
// $: 'jquery',
// jQuery: 'jquery',
// 'window.jQuery': 'jquery',
// Popper: ['popper.js', 'default'],
// })
// ]
// };
// });
//Run laravel-simple-view-struct to compile view resources
//Second parâmeter true to clean the public folders
mix = require('laravel-simple-view-struct')(mix, true);
//Create the app bundle
mix.js(`${__dirname}/../datasafer-laravel/resources/js/app.js`, 'public/js')
.sass(`${__dirname}/../datasafer-laravel/resources/sass/app.scss`, 'public/css')
.copyDirectory(`${__dirname}/../datasafer-laravel/resources/static/images`,'public/images')
.sourceMaps()
.version();
//Domínio local da aplicação
if (app_url != null) {
mix.browserSync({
proxy: {
target: app_url,
proxyReq: [
function(proxyReq) {
proxyReq.setHeader('x-browsersync', true);
}
]
}
});
}
return mix;
};