Skip to content

Commit 91afdec

Browse files
authored
(chore) Migrate off of Webpack (#691)
1 parent 25b7db2 commit 91afdec

File tree

7 files changed

+77
-128
lines changed

7 files changed

+77
-128
lines changed

.swcrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://swc.rs/schema.json",
3+
"module": {
4+
"type": "es6",
5+
"resolveFully": true
6+
},
7+
"jsc": {
8+
"parser": {
9+
"syntax": "typescript",
10+
"tsx": true
11+
},
12+
"transform": {
13+
"react": {
14+
"runtime": "classic"
15+
}
16+
},
17+
"target": "es2020",
18+
"baseUrl": "src"
19+
}
20+
}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
coverageReporters: ['json-summary', 'lcov'],
1414
collectCoverageFrom: ['./src/**', '!./src/components/**/*.snap'],
1515
transform: {
16-
'^.+\\.[jt]sx?$': ['@swc/jest'],
16+
'^.+\\.[jt]sx?$': ['@swc/jest', { swcrc: false }],
1717
},
1818
transformIgnorePatterns: ['/node_modules/(?!@openmrs|.+\\.pnp\\.[^\\/]+$)'],
1919
moduleDirectories: ['node_modules', '__mocks__', __dirname],

package.json

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
"name": "@openmrs/esm-form-engine-lib",
33
"version": "4.0.0",
44
"description": "React Form Engine for O3",
5-
"browser": "dist/openmrs-esm-form-engine-lib.js",
6-
"main": "src/index.ts",
5+
"main": "dist/index.js",
6+
"module": "dist/index.js",
7+
"types": "dist/index.d.ts",
78
"license": "MIT",
89
"homepage": "https://github.com/openmrs/openmrs-esm-form-engine-lib#readme",
910
"scripts": {
1011
"lint": "eslint src --ext .ts,.tsx --fix",
1112
"verify": "turbo run lint typescript test --concurrency=5",
12-
"test": "jest --config ./jest.config.js --passWithNoTests --color",
13-
"test:watch": "jest --config ./jest.config.js --watch --color",
13+
"test": "TZ=UTC jest --config ./jest.config.js --passWithNoTests --color",
14+
"test:watch": "TZ=UTC jest --config ./jest.config.js --watch --color",
1415
"typescript": "tsc",
15-
"build": "webpack --mode production",
16+
"build": "rimraf dist && concurrently \"swc --copy-files --ignore '**/*.test.*' --ignore '**/setup-tests.*' --ignore '**/test-utils.*' src -d dist\" \"tsc --project tsconfig.build.json\"",
1617
"coverage": "yarn test --coverage",
17-
"analyze": "webpack --mode=production --env.analyze=true",
1818
"prepare": "husky install",
1919
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.ts' --config './tools/i18next-parser.config.js'"
2020
},
@@ -60,18 +60,14 @@
6060
"@types/lodash": "^4.17.4",
6161
"@types/lodash-es": "^4.17.12",
6262
"@types/react": "^18.3.2",
63-
"@types/webpack-env": "^1.18.5",
6463
"@typescript-eslint/eslint-plugin": "^7.9.0",
6564
"@typescript-eslint/parser": "^7.9.0",
66-
"clean-webpack-plugin": "^3.0.0",
6765
"concurrently": "^6.5.1",
68-
"css-loader": "^6.11.0",
6966
"dayjs": "^1.11.11",
7067
"eslint": "^8.57.0",
7168
"eslint-plugin-import": "^2.31.0",
7269
"eslint-plugin-jsx-a11y": "^6.8.0",
7370
"eslint-plugin-react-hooks": "^4.6.2",
74-
"fork-ts-checker-webpack-plugin": "^6.5.3",
7571
"husky": "^8.0.3",
7672
"i18next": "^25.0.0",
7773
"i18next-parser": "^9.3.0",
@@ -87,15 +83,11 @@
8783
"react-dom": "^18.3.1",
8884
"react-i18next": "^16.0.0",
8985
"resize-observer-polyfill": "^1.5.1",
86+
"rimraf": "^5.0.0",
9087
"sass": "^1.77.2",
91-
"swc-loader": "^0.2.6",
9288
"swr": "^2.2.5",
9389
"turbo": "^2.5.2",
94-
"typescript": "^5.0.0",
95-
"webpack": "^5.99.9",
96-
"webpack-bundle-analyzer": "^4.10.2",
97-
"webpack-cli": "^6.0.1",
98-
"webpack-dev-server": "^5.2.1"
90+
"typescript": "^5.0.0"
9991
},
10092
"lint-staged": {
10193
"*.{ts,tsx}": "eslint --cache --fix --max-warnings 0",

src/routes.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

tsconfig.build.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false,
5+
"declaration": true,
6+
"declarationMap": true,
7+
"declarationDir": "dist",
8+
"emitDeclarationOnly": true
9+
},
10+
"exclude": ["**/*.test.*", "**/setup-tests.*", "**/test-utils.*", "**/__mocks__/**"]
11+
}

webpack.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)