-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.plugins.js
47 lines (45 loc) · 1.21 KB
/
webpack.plugins.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
46
47
const path = require('path');
const webpack = require('webpack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
// Read from .env file
require('dotenv').config();
module.exports = [
// Make compile-time env variables available with `process.env.ENV_VARIABLE`
new webpack.EnvironmentPlugin([
// Avoid hardcoding these configuration parameters:
'NPLD_PLAYER_PREFIX',
'NPLD_PLAYER_INITIAL_WEB_ADDRESS',
'NPLD_PLAYER_AUTH_TOKEN_NAME',
'NPLD_PLAYER_AUTH_TOKEN_VALUE',
'NPLD_PLAYER_ENABLE_PRINT',
'NPLD_PLAYER_ALLOW_DEVTOOLS'
]),
new ForkTsCheckerWebpackPlugin(),
new CopyPlugin({
patterns: [
// Copy Shoelace assets to public/shoelace
{
from: path.resolve(
__dirname,
'node_modules/@shoelace-style/shoelace/dist/assets'
),
to: path.resolve(
__dirname,
'.webpack/renderer/main_window/public/shoelace/assets'
),
},
// Copy icons too
{
from: path.resolve(
__dirname,
'icons'
),
to: path.resolve(
__dirname,
'.webpack/icons'
),
}
],
}),
];