Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
fix: read .version correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Apr 12, 2020
1 parent c1ce057 commit 468e431
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const webpack = require('webpack')

let v = 'unknown'
try {
v = fs.readFileSync(path.join(process.cwd(), '.version')).trim()
v = fs
.readFileSync(path.join(process.cwd(), '.version'))
.toString()
.trim()
} catch {
v = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')))
.version
Expand Down

0 comments on commit 468e431

Please sign in to comment.