Skip to content

Commit 7770f51

Browse files
authored
Use Preconstruct (#17)
* Use Preconstruct * tweak
1 parent dc0d53e commit 7770f51

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.babelrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ module.exports = {
66
loose: true,
77
modules: false,
88
targets: {
9-
node: 6,
9+
node: 18,
1010
},
1111
},
1212
],
1313
],
14-
plugins: ['@babel/transform-modules-commonjs'],
1514
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
node_modules
2-
lib
2+
dist

package.json

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,25 @@
44
"description": "Babel plugin for annotating automatically pure function calls.",
55
"author": "Mateusz Burzyński <mateuszburzynski@gmail.com> (https://github.com/Andarist)",
66
"license": "MIT",
7-
"main": "lib/index.js",
7+
"engines": {
8+
"node": ">=18"
9+
},
10+
"main": "dist/babel-plugin-annotate-pure-calls.cjs.js",
11+
"module": "dist/babel-plugin-annotate-pure-calls.esm.js",
12+
"exports": {
13+
".": {
14+
"types": {
15+
"import": "./dist/babel-plugin-annotate-pure-calls.cjs.mjs",
16+
"default": "./dist/babel-plugin-annotate-pure-calls.cjs.js"
17+
},
18+
"module": "./dist/babel-plugin-annotate-pure-calls.esm.js",
19+
"import": "./dist/babel-plugin-annotate-pure-calls.cjs.mjs",
20+
"default": "./dist/babel-plugin-annotate-pure-calls.cjs.js"
21+
},
22+
"./package.json": "./package.json"
23+
},
824
"files": [
9-
"lib"
25+
"dist"
1026
],
1127
"repository": {
1228
"type": "git",
@@ -23,7 +39,6 @@
2339
"url": "https://github.com/Andarist/babel-plugin-annotate-pure-calls/issues"
2440
},
2541
"homepage": "https://github.com/Andarist/babel-plugin-annotate-pure-calls#readme",
26-
"dependencies": {},
2742
"peerDependencies": {
2843
"@babel/core": "^7.0.0"
2944
},
@@ -32,14 +47,15 @@
3247
"@babel/core": "^7.1.0",
3348
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
3449
"@babel/preset-env": "^7.1.0",
50+
"@preconstruct/cli": "^2.8.10",
3551
"babel-plugin-tester": "^5.4.0",
3652
"husky": "^0.14.3",
3753
"jest": "^23.1.0",
3854
"lint-staged": "^7.1.3",
3955
"prettier": "^1.13.5"
4056
},
4157
"scripts": {
42-
"build": "babel src --out-dir lib",
58+
"build": "preconstruct build",
4359
"pretest": "npm run build",
4460
"test": "jest",
4561
"precommit": "lint-staged",
@@ -56,5 +72,13 @@
5672
"semi": false,
5773
"trailingComma": "all",
5874
"proseWrap": "always"
75+
},
76+
"preconstruct": {
77+
"exports": {
78+
"importConditionDefaultExport": "default"
79+
},
80+
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
81+
"importsConditions": true
82+
}
5983
}
6084
}

0 commit comments

Comments
 (0)