-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
94 lines (90 loc) · 3.07 KB
/
webpack.config.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const LwcWebpackPlugin = require('lwc-webpack-plugin');
const path = require('path');
const config = {
entry: {
fallback: './src/client/index.js',
dataTools: './src/client/dataTools.js',
salesforceconfig: './src/client/salesforceconfig.js',
platformeventactivity: './src/client/platformeventactivity.js',
salesforcenotification: './src/client/salesforcenotification.js'
},
mode: 'production',
output: {
path: path.resolve('dist'),
filename: './[name].js'
},
plugins: [
new CleanWebpackPlugin(),
new LwcWebpackPlugin({
modules: [
{ dir: 'src/client/modules' },
{ npm: 'lightning-base-components' }
]
}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
filename: './index.html',
title: 'fallback',
chunks: ['fallback']
}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
filename: './dataTools.html',
title: 'Data Tools',
chunks: ['dataTools']
}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
filename: './salesforceconfig/app.html',
title: 'Salesforce Config',
chunks: ['salesforceconfig']
}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
filename: './platformevent/activity.html',
title: 'Platform Event Activity',
chunks: ['platformeventactivity']
}),
new HtmlWebpackPlugin({
template: 'src/client/index.html',
filename: './salesforcenotification/activity.html',
title: 'Salesforce Notification Activity',
chunks: ['salesforcenotification']
}),
new CopyPlugin({
patterns: [
{
from: 'src/client/assets',
to: 'assets/'
},
{
from: 'node_modules/@salesforce-ux/design-system/assets/images',
to: 'assets/images'
},
{
from: 'node_modules/@salesforce-ux/design-system/assets/icons',
to: 'assets/icons'
},
{
from: 'node_modules/@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css',
to: 'assets/styles/salesforce-lightning-design-system.min.css'
}
]
})
],
stats: { assets: false }
};
// development only
if (process.env.NODE_ENV !== 'production') {
require('dotenv').config();
config.mode = 'development';
config.devtool = 'source-map';
config.watchOptions = {
ignored: /node_modules/,
aggregateTimeout: 5000
};
}
module.exports = config;