mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-01 03:07:53 +00:00
82 lines
1.7 KiB
JavaScript
82 lines
1.7 KiB
JavaScript
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
const path = require('path');
|
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
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()],
|
|
},
|
|
|
|
plugins: [
|
|
new HtmlWebPackPlugin({
|
|
template: './app/index.html',
|
|
filename: './index.html',
|
|
}),
|
|
],
|
|
};
|