testpub-ssr
Version:
Test Pub SSR
64 lines (60 loc) • 1.54 kB
JavaScript
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const { merge } = require('webpack-merge');
const paths = require('./paths');
const common = require('./webpack.common.js');
const dotenv = require('dotenv-webpack');
module.exports = merge(common, {
entry: ['./src/index.tsx'],
mode: 'production',
devtool: false,
output: {
path: paths.build,
publicPath: './',
filename: 'selectives.js',
},
module: {
rules: [
{
test: /\.(scss|css)$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {},
},
'sass-loader',
],
},
],
},
plugins: [
new dotenv({
path: './.env.production',
systemvars: true,
ignoreStubs: true,
}),
// compile to single css file if needed
// new MiniCssExtractPlugin({
// filename: "[name].styles.css",
// }),
// new HtmlWebpackPlugin({
// title: 'webpack Boilerplate',
// template: 'index.html',
// filename: 'index.html',
// }),
// Compress to gzip if needed
// new CompressionPlugin(),
],
optimization: {
minimize: true,
minimizer: [new CssMinimizerPlugin(), '...'],
},
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000,
},
});