-
-
Notifications
You must be signed in to change notification settings - Fork 450
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
33 lines (32 loc) · 906 Bytes
/
webpack.prod.js
File metadata and controls
33 lines (32 loc) · 906 Bytes
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
const { merge } = require('webpack-merge');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const baseConfig = require('./webpack.common.js');
/** @type {import('webpack').Configuration} */
module.exports = merge(baseConfig, {
mode: 'production',
entry: {
app: ['core-js/stable', path.resolve(__dirname, 'src/index.tsx')],
},
output: {
path: path.resolve(__dirname, 'docs'),
filename: 'js/[name].[contenthash].js',
chunkFilename: 'js/[id].[contenthash].js',
publicPath: './',
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
title: 'React Design Editor',
meta: {
description: 'React Design Editor with direct manipulation like PowerPoint',
},
}),
new WorkboxPlugin.GenerateSW({
skipWaiting: true,
clientsClaim: true,
swDest: 'sw.js',
}),
],
});