Skip to content

Commit e871fd8

Browse files
committed
chore: update templates
1 parent bd8f287 commit e871fd8

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
lines changed

templates/rspack.config.cjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ module.exports = {
1515
},
1616
module: {
1717
rules: [
18-
...Repack.getJsTransformRules(),
18+
{
19+
test: /\.[cm]?[jt]sx?$/,
20+
type: 'javascript/auto',
21+
use: {
22+
loader: '@callstack/repack/babel-swc-loader',
23+
parallel: true,
24+
options: {},
25+
},
26+
},
1927
...Repack.getAssetTransformRules(),
2028
],
2129
},

templates/rspack.config.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ export default {
2020
},
2121
module: {
2222
rules: [
23-
...Repack.getJsTransformRules(),
23+
{
24+
test: /\.[cm]?[jt]sx?$/,
25+
type: 'javascript/auto',
26+
use: {
27+
loader: '@callstack/repack/babel-swc-loader',
28+
parallel: true,
29+
options: {},
30+
},
31+
},
2432
...Repack.getAssetTransformRules(),
2533
],
2634
},

templates/webpack.config.cjs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const Repack = require('@callstack/repack');
2-
const TerserPlugin = require('terser-webpack-plugin');
32

43
/**
54
* Webpack configuration enhanced with Re.Pack defaults for React Native.
@@ -18,24 +17,14 @@ module.exports = {
1817
rules: [
1918
{
2019
test: /\.[cm]?[jt]sx?$/,
21-
use: 'babel-loader',
2220
type: 'javascript/auto',
21+
use: {
22+
loader: '@callstack/repack/babel-swc-loader',
23+
options: {},
24+
},
2325
},
2426
...Repack.getAssetTransformRules(),
2527
],
2628
},
27-
optimization: {
28-
minimizer: [
29-
new TerserPlugin({
30-
test: /\.(js)?bundle(\?.*)?$/i,
31-
extractComments: false,
32-
terserOptions: {
33-
format: {
34-
comments: false,
35-
},
36-
},
37-
}),
38-
],
39-
},
4029
plugins: [new Repack.RepackPlugin()],
4130
};

templates/webpack.config.mjs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
33
import * as Repack from '@callstack/repack';
4-
import TerserPlugin from 'terser-webpack-plugin';
54

65
const __filename = fileURLToPath(import.meta.url);
76
const __dirname = path.dirname(__filename);
@@ -23,24 +22,14 @@ export default {
2322
rules: [
2423
{
2524
test: /\.[cm]?[jt]sx?$/,
26-
use: 'babel-loader',
2725
type: 'javascript/auto',
26+
use: {
27+
loader: '@callstack/repack/babel-swc-loader',
28+
options: {},
29+
},
2830
},
2931
...Repack.getAssetTransformRules(),
3032
],
3133
},
32-
optimization: {
33-
minimizer: [
34-
new TerserPlugin({
35-
test: /\.(js)?bundle(\?.*)?$/i,
36-
extractComments: false,
37-
terserOptions: {
38-
format: {
39-
comments: false,
40-
},
41-
},
42-
}),
43-
],
44-
},
4534
plugins: [new Repack.RepackPlugin()],
4635
};

0 commit comments

Comments
 (0)