-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (43 loc) · 1.36 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
const paths = require('./paths');
process.env.NODE_ENV = 'production';
module.exports = function (webpackEnv) {
const isEnvDevelopment = webpackEnv === 'development';
const isEnvProduction = webpackEnv === 'production';
return {
mode: "production",
bail: isEnvProduction,
devtool: isEnvProduction ? 'source-map' : 'cheap-module-source-map',
entry: {
'PluginBridge': './src/PluginBridge.ts',
'ParentMessage': './src/ParentMessage.ts'
},
output: {
filename: '[name].js',
path: paths.buildPath,
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
fallback: {
"crypto": false
}
},
module: {
rules: [
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: paths.pluginPackagePath,
loader: require.resolve('babel-loader'),
options: {
presets: [
[
require.resolve('babel-preset-react-app')
],
],
sourceMaps: true,
inputSourceMap: true
},
},
]
},
}
};