Skip to content

Commit

Permalink
feat(nano-build): __package_version__ types
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm authored and alimd committed Jan 3, 2024
1 parent bc7c7ee commit 7894c4b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/nano-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Add the following scripts to your `package.json`:
js: "/* @package_name v@package_version */"
},
define: {
__package_version: `'@package_version'`,
__package_version__: `'@package_version'`,
},
}
```
Expand Down
5 changes: 5 additions & 0 deletions packages/nano-build/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export {};

declare global {
var __package_version__: string;
}
2 changes: 1 addition & 1 deletion packages/nano-build/nano-build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const defaultOptions = {
js: '/* ' + packageJson.name + ' v' + packageJson.version + ' */',
},
define: {
__package_version: `'${packageJson.version}'`,
__package_version__: `'${packageJson.version}'`,
},
};

Expand Down
2 changes: 2 additions & 0 deletions packages/nano-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
],
"type": "commonjs",
"bin": "./nano-build.cjs",
"main": "",
"types": "./global.d.ts",
"license": "MIT",
"files": [
"**/*.{js,mjs,cjs,map,d.ts,html,md}",
Expand Down

0 comments on commit 7894c4b

Please sign in to comment.