mirror of
https://github.com/tl-open-source/tl-rtc-file.git
synced 2025-10-06 07:56:51 +08:00
69 lines
1.7 KiB
JavaScript
69 lines
1.7 KiB
JavaScript
const path = require('path');
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
|
const watchNewEntry = require('../plugin/watchNewEntry');
|
|
const { JS_PATH, CSS_PATH } = require('../comm/path');
|
|
|
|
module.exports = {
|
|
mode: 'production',
|
|
devtool: 'eval',
|
|
watchOptions: {
|
|
ignored: /node_modules/,
|
|
aggregateTimeout: 500,
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
include: JS_PATH,
|
|
use: [
|
|
'thread-loader',
|
|
{
|
|
loader: 'babel-loader'
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
exclude: /node_modules/,
|
|
use: [
|
|
MiniCssExtractPlugin.loader,
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
importLoaders: 1,
|
|
url: false
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
path: path.resolve(CSS_PATH, "./"),
|
|
filename: '[name].min.css',
|
|
ignoreOrder: false,
|
|
}),
|
|
new watchNewEntry(),
|
|
],
|
|
resolve: {
|
|
extensions: [
|
|
'.js',
|
|
],
|
|
},
|
|
stats: {
|
|
children: false,
|
|
},
|
|
externals: {
|
|
jquery: 'jQuery',
|
|
},
|
|
optimization: {
|
|
minimize: true,
|
|
minimizer: [
|
|
new UglifyJSPlugin()
|
|
]
|
|
},
|
|
};
|