|
|
|
const webpack = require('webpack');
|
|
|
|
const merge = require('webpack-merge');
|
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
|
|
const vars = require('postcss-simple-vars');
|
|
|
|
|
|
|
|
const dirs = require('./dirs');
|
|
|
|
|
|
|
|
const common = require('./webpack.common.js');
|
|
|
|
|
|
|
|
module.exports = merge.smart(common, {
|
|
|
|
mode: 'production',
|
|
|
|
|
|
|
|
devtool: 'hidden-source-map',
|
|
|
|
entry: {
|
|
|
|
show: ['@babel/polyfill', './src/modules/app.ts'],
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: dirs.DEST,
|
|
|
|
filename: 'connection.min.js'
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
path: dirs.DEST,
|
|
|
|
filename: "connection.min.css"
|
|
|
|
}),
|
|
|
|
new webpack.BannerPlugin({
|
|
|
|
banner: `time: ${new Date().toLocaleString()}`
|
|
|
|
})
|
|
|
|
],
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.(css|less)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
options: {
|
|
|
|
plugins: [vars({
|
|
|
|
variables: {
|
|
|
|
fontUrl: '/webroot/decision/resources?path=/com/fr/web/ui/font',
|
|
|
|
imageUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/1x',
|
|
|
|
image2xUrl: '/webroot/decision/resources?path=/com/fr/web/resources/dist/images/2x',
|
|
|
|
}
|
|
|
|
})]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|