-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.renderer.pro.js
More file actions
32 lines (27 loc) · 1.04 KB
/
webpack.config.renderer.pro.js
File metadata and controls
32 lines (27 loc) · 1.04 KB
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
import chalk from 'chalk';
import merge from 'webpack-merge';
import path from 'path';
import webpack from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import baseConfig from './webpack.config.renderer.base';
import checkEnv from './internal/checkenv';
checkEnv('production');
const buildPath = path.join(__dirname, 'build');
export default merge.smart(baseConfig, {
output: {
path: path.join(buildPath, 'public', 'js'),
filename: 'bundle.js',
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),
}),
new CopyWebpackPlugin([
{ from: path.join(__dirname, 'package.json'), to: buildPath },
{ from: path.join(__dirname, 'index.js'), to: buildPath },
{ from: path.join(__dirname, 'LICENSE'), to: buildPath },
{ from: path.join(__dirname, 'public', 'index.html'), to: path.join(buildPath, 'public') },
{ from: path.join(__dirname, 'libs'), to: path.join(buildPath, 'libs') },
], { copyUnmodified: true }),
],
});