mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-10-29 09:52:36 +00:00
88 lines
1.9 KiB
JavaScript
88 lines
1.9 KiB
JavaScript
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
const path = require('path');
|
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
mode: process.env.NODE_ENV,
|
|
entry: './app/index.js',
|
|
output: {
|
|
path: path.join(__dirname, 'dist'),
|
|
publicPath: '/',
|
|
filename: 'bundle.js',
|
|
},
|
|
devServer: {
|
|
port: 3000,
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: /node_modules/,
|
|
use: ['babel-loader', 'eslint-loader'],
|
|
},
|
|
{
|
|
test: /\.less$/,
|
|
use: [
|
|
{
|
|
loader: 'style-loader',
|
|
},
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
modules: {
|
|
localIdentName: '[name]__[local]___[hash:base64:5]',
|
|
},
|
|
sourceMap: true,
|
|
},
|
|
},
|
|
{
|
|
loader: 'less-loader',
|
|
options: {
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.(css|scss)$/,
|
|
exclude: /node_modules/,
|
|
use: [
|
|
{
|
|
loader: 'style-loader',
|
|
},
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
modules: {
|
|
localIdentName: '[name]__[local]___[hash:base64:5]',
|
|
},
|
|
sourceMap: true,
|
|
},
|
|
},
|
|
{
|
|
loader: 'sass-loader',
|
|
options: {
|
|
sourceMap: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
optimization: {
|
|
minimizer: [new UglifyJsPlugin()],
|
|
},
|
|
resolve: {
|
|
modules: ['node_modules', path.resolve(`${__dirname}/app`)],
|
|
alias: {
|
|
app: path.resolve(`${__dirname}/app`),
|
|
},
|
|
},
|
|
plugins: [
|
|
new HtmlWebPackPlugin({
|
|
template: './app/index.html',
|
|
filename: './index.html',
|
|
}),
|
|
],
|
|
};
|