forked from callstack/repack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.cjs
41 lines (39 loc) · 950 Bytes
/
webpack.config.cjs
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
const Repack = require('@callstack/repack');
const TerserPlugin = require('terser-webpack-plugin');
/**
* Webpack configuration enhanced with Re.Pack defaults for React Native.
*
* Learn about webpack configuration: https://webpack.js.org/configuration/
* Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
*/
module.exports = {
context: __dirname,
entry: './index.js',
resolve: {
...Repack.getResolveOptions(),
},
module: {
rules: [
{
test: /\.[cm]?[jt]sx?$/,
use: 'babel-loader',
type: 'javascript/auto',
},
...Repack.getAssetTransformRules(),
],
},
optimization: {
minimizer: [
new TerserPlugin({
test: /\.(js)?bundle(\?.*)?$/i,
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
}),
],
},
plugins: [new Repack.RepackPlugin()],
};