Skip to content

Commit fd2f67d

Browse files
authored
chore: bump swc and webpack-dev-server for examples (#512)
1 parent 0c910b1 commit fd2f67d

File tree

22 files changed

+1623
-5209
lines changed

22 files changed

+1623
-5209
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ module.exports = {
259259
> **:warning: Warning**:
260260
> This is an un-official integration maintained by the community.
261261
262-
Ensure your `@swc/core` version is at least `1.2.52`.
262+
Ensure your `@swc/core` version is at least `1.2.86`.
263263
It is also recommended to use `swc-loader` version `0.1.13` or above.
264264

265265
Then, instead of wiring up `react-refresh/babel` via `babel-loader`,

examples/flow-with-babel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react-refresh": "^0.10.0",
2020
"webpack": "^5.52.1",
2121
"webpack-cli": "^4.8.0",
22-
"webpack-dev-server": "^3.11.2"
22+
"webpack-dev-server": "^4.1.1"
2323
},
2424
"scripts": {
2525
"start": "webpack serve --hot",

examples/flow-with-babel/src/App.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22

33
import { lazy, Suspense } from 'react';
4+
import { ArrowFunction } from './ArrowFunction';
45
import ClassDefault from './ClassDefault';
56
import { ClassNamed } from './ClassNamed';
67
import FunctionDefault from './FunctionDefault';
@@ -15,6 +16,7 @@ function App() {
1516
<ClassNamed />
1617
<FunctionDefault />
1718
<FunctionNamed />
19+
<ArrowFunction />
1820
<Suspense fallback={<h1>Loading</h1>}>
1921
<LazyComponent />
2022
</Suspense>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @flow
2+
3+
export const ArrowFunction = () => <h1>Arrow Function</h1>;

examples/flow-with-babel/yarn.lock

Lines changed: 418 additions & 1258 deletions
Large diffs are not rendered by default.

examples/typescript-with-swc/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
},
99
"devDependencies": {
1010
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.0",
11-
"@swc/core": "^1.2.85",
11+
"@swc/core": "^1.2.88",
1212
"@types/react": "^17.0.20",
1313
"@types/react-dom": "^17.0.9",
14+
"core-js": "^3.17.3",
1415
"cross-env": "^7.0.3",
1516
"fork-ts-checker-webpack-plugin": "^6.3.3",
1617
"html-webpack-plugin": "^5.3.2",
@@ -19,7 +20,7 @@
1920
"typescript": "4.4.3",
2021
"webpack": "^5.52.1",
2122
"webpack-cli": "^4.8.0",
22-
"webpack-dev-server": "^3.11.2"
23+
"webpack-dev-server": "^4.1.1"
2324
},
2425
"scripts": {
2526
"start": "webpack serve --hot",

examples/typescript-with-swc/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { lazy, Suspense } from 'react';
2+
import { ArrowFunction } from './ArrowFunction';
23
import ClassDefault from './ClassDefault';
34
import { ClassNamed } from './ClassNamed';
45
import FunctionDefault from './FunctionDefault';
@@ -13,6 +14,7 @@ function App() {
1314
<ClassNamed />
1415
<FunctionDefault />
1516
<FunctionNamed />
17+
<ArrowFunction />
1618
<Suspense fallback={<h1>Loading</h1>}>
1719
<LazyComponent />
1820
</Suspense>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const ArrowFunction = () => <h1>Arrow Function</h1>;

examples/typescript-with-swc/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
{
2020
loader: 'swc-loader',
2121
options: {
22+
env: { mode: 'usage' },
2223
jsc: {
2324
parser: {
2425
syntax: 'typescript',

examples/typescript-with-swc/yarn.lock

Lines changed: 424 additions & 1392 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)