67 lines
1.8 KiB
JavaScript
67 lines
1.8 KiB
JavaScript
const mix = require("laravel-mix");
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| 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 the application as well as bundling up all the JS files.
|
|
|
|
|
*/
|
|
|
|
mix.js("resources/js/app.js", "public/js")
|
|
.sass("resources/sass/app.scss", "public/css")
|
|
.js(
|
|
"resources/js/warehouse_management/product_categories/index.js",
|
|
"public/js/warehouse_management/product_categories"
|
|
)
|
|
.js(
|
|
"resources/js/warehouse_management/products/index.js",
|
|
"public/js/warehouse_management/products"
|
|
)
|
|
.js(
|
|
"resources/js/warehouse_management/products/create.js",
|
|
"public/js/warehouse_management/products"
|
|
)
|
|
.js(
|
|
"resources/js/warehouse_management/products/edit.js",
|
|
"public/js/warehouse_management/products"
|
|
)
|
|
.sourceMaps();
|
|
|
|
mix.browserSync({
|
|
proxy: "127.0.0.1:8000",
|
|
open: false,
|
|
files: [
|
|
"app/**/*.php",
|
|
"resources/views/**/*.php",
|
|
"resources/js/**/*.js",
|
|
"resources/sass/**/*.scss",
|
|
"public/js/**/*.js",
|
|
"public/css/**/*.css",
|
|
],
|
|
});
|
|
mix.setPublicPath("public");
|
|
mix.setResourceRoot("/");
|
|
const devServerPort = process.env.MIX_DEV_SERVER_PORT || 8080;
|
|
|
|
mix.webpackConfig({
|
|
devServer: {
|
|
host: process.env.MIX_DEV_SERVER_HOST || "localhost",
|
|
port: devServerPort,
|
|
hot: true,
|
|
headers: {
|
|
"Access-Control-Allow-Origin": "*",
|
|
},
|
|
},
|
|
});
|
|
|
|
mix.options({
|
|
hmrOptions: {
|
|
host: process.env.MIX_DEV_SERVER_HOST || "localhost",
|
|
port: devServerPort,
|
|
},
|
|
});
|