12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- const merge = require('webpack-merge')
- const commonConf = require('./webpack.common.js')
- const MiniCssExtractPlugin = require('mini-css-extract-plugin')
- const TerserJSPlugin = require('terser-webpack-plugin')
- const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
- const CopyWebpackPlugin = require('copy-webpack-plugin')
- const path = require('path')
- const prodConf = {
- mode: 'production',
- devtool: 'cheap-module-source-map',
- output: {
- path: path.resolve(__dirname, '../../../pub/zq2019/lolSkinShow'),
- publicPath: `//pub.dwstatic.com/zq2019/lolSkinShow/`
- },
- module: {
- rules: [
- {
- test: /\.(scss|css)$/,
- use: [
- MiniCssExtractPlugin.loader,
- {
- loader: 'css-loader',
- options: {
- importLoaders: 2
- }
- },
- 'sass-loader',
- 'postcss-loader'
- ]
- },
- {
- test: /\.module\.(scss|css)$/,
- use: [
- MiniCssExtractPlugin.loader,
- {
- loader: 'css-loader',
- options: {
- importLoaders: 2,
- modules: true
- }
- },
- 'sass-loader',
- 'postcss-loader'
- ]
- }
- ]
- },
- plugins: [
- new MiniCssExtractPlugin({
- filename: 'css/[name]_[contenthash:5].css',
- chunkFilename: 'css/[id]_[contenthash:5].css'
- }),
- new CopyWebpackPlugin([
- { from: 'src/assets/duowanFooter.min.js', to: 'js' }
- ])
- ],
- optimization: {
- minimizer: [
- new TerserJSPlugin({
- sourceMap: true
- }),
- new OptimizeCSSAssetsPlugin({})
- ]
- }
- }
- module.exports = merge(commonConf, prodConf)
|