Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb289722

Browse files
authored
feat: update new project templates for Re.Pack 5.2 (#1263)
1 parentef35799 commitb289722

File tree

5 files changed

+39
-40
lines changed

5 files changed

+39
-40
lines changed

‎.changeset/ripe-humans-press.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@callstack/repack":minor
3+
---
4+
5+
Update new project templates for Re.Pack 5.2

‎templates/rspack.config.cjs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@ const Repack = require('@callstack/repack');
77
* Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
88
*/
99

10-
module.exports={
10+
module.exports=Repack.defineRspackConfig({
1111
context:__dirname,
1212
entry:'./index.js',
1313
resolve:{
1414
...Repack.getResolveOptions(),
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
},
2230
plugins:[newRepack.RepackPlugin()],
23-
};
31+
});

‎templates/rspack.config.mjs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,25 @@ const __dirname = path.dirname(__filename);
1212
* Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
1313
*/
1414

15-
exportdefault{
15+
exportdefaultRepack.defineRspackConfig({
1616
context:__dirname,
1717
entry:'./index.js',
1818
resolve:{
1919
...Repack.getResolveOptions(),
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
},
2735
plugins:[newRepack.RepackPlugin()],
28-
};
36+
});

‎templates/webpack.config.cjs‎

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

43
/**
54
* Webpack configuration enhanced with Re.Pack defaults for React Native.
@@ -8,7 +7,7 @@ const TerserPlugin = require('terser-webpack-plugin');
87
* Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
98
*/
109

11-
module.exports={
10+
module.exports=Repack.defineWebpackConfig({
1211
context:__dirname,
1312
entry:'./index.js',
1413
resolve:{
@@ -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-
newTerserPlugin({
30-
test:/\.(js)?bundle(\?.*)?$/i,
31-
extractComments:false,
32-
terserOptions:{
33-
format:{
34-
comments:false,
35-
},
36-
},
37-
}),
38-
],
39-
},
4029
plugins:[newRepack.RepackPlugin()],
41-
};
30+
});

‎templates/webpack.config.mjs‎

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

65
const__filename=fileURLToPath(import.meta.url);
76
const__dirname=path.dirname(__filename);
@@ -13,7 +12,7 @@ const __dirname = path.dirname(__filename);
1312
* Learn about Re.Pack configuration: https://re-pack.dev/docs/guides/configuration
1413
*/
1514

16-
exportdefault{
15+
exportdefaultRepack.defineWebpackConfig({
1716
context:__dirname,
1817
entry:'./index.js',
1918
resolve:{
@@ -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-
newTerserPlugin({
35-
test:/\.(js)?bundle(\?.*)?$/i,
36-
extractComments:false,
37-
terserOptions:{
38-
format:{
39-
comments:false,
40-
},
41-
},
42-
}),
43-
],
44-
},
4534
plugins:[newRepack.RepackPlugin()],
46-
};
35+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp