-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.common-sdk.js
39 lines (37 loc) · 1.05 KB
/
webpack.common-sdk.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
/*
* The Webpack configuration file for the front end JavaScript using React.
* For background on the concerns that led to this being a separate Webpack
* config, see:
* https://stackoverflow.com/questions/50805626/webpack-4-multiple-sets-of-entries-with-code-splitting-unique-to-each
*/
const webpack = require('webpack');
module.exports = {
entry: './assets/sdk/entries/sdk.jsx',
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /.jsx?$/,
exclude: /node_modules\/(?!(query-string|split-on-first|strict-uri-encode)\/).*/,
use: {
loader: 'babel-loader',
options: {
presets: ["@babel/preset-env", "@babel/preset-react"]
}
}
}
]
},
plugins: [
new webpack.ProvidePlugin({})
],
output: {
path: __dirname,
filename: 'sdk.js',
libraryTarget: 'commonjs2',
},
externals: {},
node: {}
};