-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.prod.js
41 lines (40 loc) · 1.15 KB
/
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
37
38
39
40
41
const { DefinePlugin } = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const Dotenv = require('dotenv-webpack');
const CopyPlugin = require('copy-webpack-plugin');
const {
transformManifestFiles,
} = require('./build-scripts/manifestHelpers.js');
require('dotenv').config({ path: './.env.production' });
module.exports = merge(common, {
mode: 'production',
plugins: [
new Dotenv({
path: '.env.production',
ignoreStub: true,
safe: false, // the '.env' variables are set in the build workflow
}),
new DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
new CopyPlugin({
patterns: [
{
context: 'manifest/',
from: '**/*.json',
to: '../',
transform: transformManifestFiles({
name: 'Core | Crypto Wallet & NFT Extension',
shortName: 'Core',
actionDefaultTitle: 'Core | Crypto Wallet & NFT Extension',
oAuthClientId: process.env.GOOGLE_OAUTH_CLIENT_ID,
}),
force: true,
},
],
}),
],
});