feat(main): Add base theme: This is the falcon theme out of the box.
This is falcon v3.1.2
This commit is contained in:
44
falcon/_dev/webpack/webpack.production.js
Normal file
44
falcon/_dev/webpack/webpack.production.js
Normal file
@ -0,0 +1,44 @@
|
||||
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
const PurgeCSSPlugin = require('purgecss-webpack-plugin');
|
||||
const safeList = require('./purge-safelist');
|
||||
const glob = require('glob-all');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const { cleanDistFolders } = require('./webpack.parts');
|
||||
const { merge } = require("webpack-merge");
|
||||
|
||||
const plugins = (purge, analyze) => ([
|
||||
analyze ? new BundleAnalyzerPlugin() : false,
|
||||
purge ? new PurgeCSSPlugin({
|
||||
paths: glob.sync([
|
||||
'js/*.js',
|
||||
'js/**/*.js',
|
||||
'../templates/**/*.tpl',
|
||||
'../modules/**/*.tpl',
|
||||
'../modules/**/*.js'
|
||||
]),
|
||||
safelist: safeList.list,
|
||||
safelistPatterns: safeList.patterns
|
||||
})
|
||||
: false
|
||||
].filter(el => el && el));
|
||||
|
||||
exports.productionConfig = ({ purge, analyze }) => (
|
||||
merge(
|
||||
{
|
||||
devtool: 'hidden-source-map',
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new ESBuildMinifyPlugin({
|
||||
target: 'es2015',
|
||||
format: 'iife'
|
||||
}),
|
||||
new CssMinimizerPlugin()
|
||||
],
|
||||
},
|
||||
plugins: plugins(purge, analyze)
|
||||
},
|
||||
cleanDistFolders()
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user