Skip to content

Commit 7186d75

Browse files
build.ts: remove "-dev" from the version string
1 parent 02e37de commit 7186d75

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/build.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function copyFile(inPath : string, outPath : string) {
66
}
77

88
interface PackageJson {
9+
version: string;
910
private: boolean;
1011
main: string;
1112
types: string;
@@ -17,9 +18,10 @@ function build() {
1718

1819
// Read package.json
1920
let packageContents : PackageJson = JSON.parse(readFileSync(join(rootDir, `package.json`), 'utf8'));
20-
packageContents.private = false;
21-
packageContents.main = packageContents.main.replace(/dist\//g, '');
22-
packageContents.types = packageContents.types.replace(/dist\//g, '');
21+
packageContents.version = packageContents.version.replace(/-dev/g, ''); // Remove "-dev" from the version number
22+
packageContents.private = false; // Make it publishable
23+
packageContents.main = packageContents.main.replace(/dist\//g, ''); // Reference this from the root of the publish directory
24+
packageContents.types = packageContents.types.replace(/dist\//g, ''); // Reference this from the root of the publish directory
2325
// Write it out to the publishing directory
2426
writeFileSync(join( outputDir , `package.json`), JSON.stringify(packageContents, null, 2)); // NOTE: this file will have LF line endings
2527
// Copy some other files to publish into the publishing directory

0 commit comments

Comments
 (0)