-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.cloud.js
More file actions
50 lines (46 loc) · 940 Bytes
/
webpack.config.cloud.js
File metadata and controls
50 lines (46 loc) · 940 Bytes
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
const path = require('path')
const webpack = require('webpack')
const nodeExternals = require("webpack-node-externals")
const shared = {
mode: 'production',
module: {
rules: [{
test: /.jsx$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/react']
}
}
]
}]
},
resolve: {
extensions: ['.js', '.jsx']
}
}
const cloud = {
...shared,
target: 'node',
node: {
__dirname: false
},
entry: './src/cloud.jsx',
externals: [nodeExternals()],
output: {
libraryTarget: "commonjs",
filename: 'index.js'
},
}
// This configuration bundles up our React app so that it can be served to the
// browser.
var browser = {
...shared,
entry: './src/browser.jsx',
output: {
filename: 'browser.js'
}
}
module.exports = [cloud, browser]