67 lines
1.6 KiB
JavaScript
67 lines
1.6 KiB
JavaScript
|
// Generated using webpack-cli https://github.com/webpack/webpack-cli
|
||
|
|
||
|
const path = require('path');
|
||
|
|
||
|
const isProduction = process.env.NODE_ENV == 'production';
|
||
|
|
||
|
|
||
|
const stylesHandler = 'style-loader';
|
||
|
|
||
|
|
||
|
|
||
|
const config = {
|
||
|
// entry: [ './src/wde-mobile.js'],
|
||
|
entry: {
|
||
|
init: './src/init.js',
|
||
|
mobile: './src/mobile.js',
|
||
|
desktop: './src/desktop.js',
|
||
|
},
|
||
|
output: {
|
||
|
// path: path.resolve(__dirname, 'dist'),
|
||
|
path: path.resolve('../res/dev-fs/wde/dist'),
|
||
|
filename: '[name].js'
|
||
|
},
|
||
|
devServer: {
|
||
|
open: true,
|
||
|
host: 'localhost',
|
||
|
},
|
||
|
plugins: [
|
||
|
// Add your plugins here
|
||
|
// Learn more about plugins from https://webpack.js.org/configuration/plugins/
|
||
|
],
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.(js|jsx)$/i,
|
||
|
loader: 'babel-loader',
|
||
|
},
|
||
|
{
|
||
|
test: /\.css$/i,
|
||
|
use: [stylesHandler,'css-loader'],
|
||
|
},
|
||
|
{
|
||
|
test: /\.less$/i,
|
||
|
use: [stylesHandler, 'css-loader', 'less-loader'],
|
||
|
},
|
||
|
{
|
||
|
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
|
||
|
type: 'asset',
|
||
|
},
|
||
|
|
||
|
// Add your rules for custom modules here
|
||
|
// Learn more about loaders from https://webpack.js.org/loaders/
|
||
|
],
|
||
|
},
|
||
|
};
|
||
|
|
||
|
module.exports = () => {
|
||
|
if (isProduction) {
|
||
|
config.mode = 'production';
|
||
|
|
||
|
|
||
|
} else {
|
||
|
config.mode = 'development';
|
||
|
}
|
||
|
return config;
|
||
|
};
|