Skip to content

Commit 2575877

Browse files
committed
Build with Babel
1 parent d705e07 commit 2575877

File tree

9 files changed

+246
-42
lines changed

9 files changed

+246
-42
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__coverage__
22
*.tgz
3-
lib
3+
build
44
node_modules

.npmignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
*.tgz
21
.*
3-
.eslintrc.js
2+
__coverage__
43
__tests__
5-
jest.setup.js
6-
node_modules
4+
dr.pogodin-react-helmet-*.tgz
75
src

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22

33
See [GitHub Releases Page](https://github.com/birdofpreyru/react-helmet/releases)
44
for changes in the released library versions.
5-
6-
### Changes Since The Last Release
7-
none

babel.module.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
plugins: [
3+
'@babel/transform-runtime',
4+
],
5+
presets: [
6+
['@babel/env', {
7+
modules: false,
8+
targets: 'defaults',
9+
}],
10+
['@babel/react', { runtime: 'automatic' }],
11+
'@babel/typescript',
12+
],
13+
};

build.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import pluginJs from '@eslint/js';
1313
import stylisticPlugin from '@stylistic/eslint-plugin';
1414

1515
export default tseslint.config(
16-
{ ignores: ['__coverage__', 'lib/'] },
16+
{ ignores: ['__coverage__', 'build/'] },
1717
{
1818
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
1919
languageOptions: {

package-lock.json

Lines changed: 204 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
"name": "@dr.pogodin/react-helmet",
33
"version": "3.0.0",
44
"description": "Thread-safe Helmet for React 19+ and friends",
5-
"main": "./lib/index.js",
6-
"module": "./lib/index.esm.js",
7-
"types": "./lib/index.d.ts",
5+
"main": "./build/common/index.js",
6+
"module": "./build/module/index.js",
7+
"types": "./build/types/index.d.ts",
88
"exports": {
9-
"types": "./lib/index.d.ts",
10-
"import": "./lib/index.esm.js",
11-
"default": "./lib/index.js"
9+
"types": "./build/types/index.d.ts",
10+
"module": "./build/module/index.js",
11+
"default": "./build/common/index.js"
1212
},
1313
"scripts": {
14-
"clean": "rimraf lib",
15-
"build": "npm run clean && NODE_ENV=production tsx build.ts && npm run types",
14+
"build": "rimraf build && npm run build:types && npm run build:common && npm run build:module",
15+
"build:common": "rimraf build/common && babel src -x .ts,.tsx --out-dir build/common --source-maps",
16+
"build:module": "rimraf build/module && babel src -x .ts,.tsx --out-dir build/module --source-maps --config-file ./babel.module.config.js",
17+
"build:types": "rimraf build/types && tsc --project tsconfig.types.json",
1618
"lint": "eslint",
1719
"test": "npm run lint && npm run typecheck && npm run jest",
1820
"typecheck": "tsc",
@@ -38,6 +40,7 @@
3840
"@babel/runtime": "^7.26.9"
3941
},
4042
"devDependencies": {
43+
"@babel/cli": "^7.27.0",
4144
"@babel/eslint-parser": "^7.26.8",
4245
"@babel/eslint-plugin": "^7.25.9",
4346
"@babel/plugin-transform-runtime": "^7.26.9",
@@ -71,6 +74,5 @@
7174
},
7275
"peerDependencies": {
7376
"react": "19"
74-
},
75-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
77+
}
7678
}

0 commit comments

Comments
 (0)