Skip to content

Commit f20ac1a

Browse files
authored
Merge pull request #9 from FrontEndDev-org/feat/v1.x
Feat/v1.x
2 parents 8de35a2 + b6a90f6 commit f20ac1a

File tree

5 files changed

+5
-28
lines changed

5 files changed

+5
-28
lines changed

package-lock.json

+1-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@
5151
"homepage": "https://github.com/FrontEndDev-org/try-flatten",
5252
"repository": "https://github.com/FrontEndDev-org/try-flatten",
5353
"license": "MIT",
54-
"dependencies": {},
5554
"devDependencies": {
5655
"@commitlint/cli": "^17.4.4",
5756
"@commitlint/config-conventional": "^17.4.4",
5857
"@commitlint/types": "^17.4.4",
59-
"@rollup/plugin-json": "^6.0.0",
6058
"@rollup/plugin-replace": "^5.0.2",
6159
"@rollup/plugin-typescript": "^11.0.0",
6260
"@types/node": "^18.15.7",

rollup.config.mjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import json from '@rollup/plugin-json';
21
import replace from '@rollup/plugin-replace';
32
import typescript from '@rollup/plugin-typescript';
43
import pkg from './package.json' assert { type: 'json' };
@@ -23,8 +22,8 @@ export default {
2322
},
2423
],
2524
plugins: [
26-
json(),
2725
replace({
26+
preventAssignment: true,
2827
'process.env.PKG_NAME': JSON.stringify(pkg.name),
2928
'process.env.PKG_VERSION': JSON.stringify(pkg.version),
3029
}),

src/const.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export const version = process.env.PKG_VERSION;
1+
export const pkgName = process.env.PKG_NAME!;
2+
export const pkgVersion = process.env.PKG_VERSION!;

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from './const';
1+
export { pkgName, pkgVersion } from './const';
22
export * from './normalize-error';
33
export * from './try-sync-flatten';
44
export * from './try-callback-flatten';

0 commit comments

Comments
 (0)