-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
36 lines (35 loc) · 871 Bytes
/
webpack.prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const TerserPlugin = require("terser-webpack-plugin");
const path = require('path');
const webpack = require('webpack');
module.exports = merge(common, {
mode: 'production',
module: {
rules: [{
test: /\.(jpe?g|png|webp|webp)$/i,
use: [{
loader: 'responsive-loader',
options: {
adapter: require('responsive-loader/sharp'),
sizes: [320, 640, 960, 1280],
outputPath: 'responsive',
}
}]
}],
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production'
}),
],
cache: {
type: "filesystem",
cacheDirectory: path.resolve(__dirname, '.webpack-cache'),
version: 'production',
}
});