-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.production.js
45 lines (42 loc) · 1.03 KB
/
webpack.production.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
37
38
39
40
41
42
43
44
45
const path = require('path')
const { common, PATHS } = require('./webpack.common')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const Dotenv = require('dotenv-webpack')
const config = Object.assign({}, common, {
mode: 'production',
optimization: {
// Disabled because it breaks IPFS: it's trying to use the class "JungleDB"... but that class name has been obfuscated...
minimize: false,
},
entry: [path.join(__dirname, `${PATHS.src}/index.ts`)],
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
})
config.plugins.push(
new HtmlWebpackPlugin({
template: `${PATHS.src}/index.html`,
inject: 'body',
cache: false,
favicon: `${PATHS.src}/favicon.ico`,
minify: true,
}),
new Dotenv({
path: './.env.production',
defaults: true,
}),
)
module.exports = config