const path = require('path'); const { VueLoaderPlugin } = require("vue-loader"); const { PROJECT_NAME, BASE_DIR, SERVICE_STATUS } = require('./Global'); module.exports = { name: PROJECT_NAME, mode: SERVICE_STATUS, devtool: 'eval', entry: { app: [`${BASE_DIR}/client/views/index.js`] }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', }, { test: /\.(js|jsx)$/, loader: 'babel-loader', }, { test: /\.(css|scss)$/, use: [ 'vue-style-loader', // Injects styles into the DOM 'css-loader', // Resolves CSS imports 'sass-loader' // Compiles SCSS to CSS ] }, { test: /\.(jpe?g|png|gif|svg|ttf|eot|woff|woff2)$/i, use: [{ loader: 'url-loader', options: { limit: 8192, // Images smaller than 8KB will be inlined as base64 fallback: require.resolve('file-loader') // For larger images, fall back to file-loader } }] } ], }, plugins: [ new VueLoaderPlugin(), // Ensures vue files are properly compiled ], output: { path: path.resolve(BASE_DIR, 'client/build'), // Absolute path for the output folder filename: 'bundle.js', // The name of the output JavaScript bundle }, resolve: { alias: { 'realgrid': path.resolve(__dirname, 'node_modules/realgrid/dist/realgrid.js'), }, extensions: ['.js', '.vue', '.json', '.scss'] // Added '.scss' for convenience }, };