Skip to content

Commit

Permalink
Automatic version update from package file
Browse files Browse the repository at this point in the history
  • Loading branch information
neilveil committed Oct 14, 2023
1 parent 49e42eb commit 6a015ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { Link } from 'react-router-dom'
import groups from './groups'
import showcases from './showcases'
import s from './styles.module.scss'

const version = 'v1.3.0'
import version from '../../version'

export default class Main extends React.Component {
state = {
Expand Down
1 change: 1 addition & 0 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default '1.4.0'
4 changes: 4 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import eslint from 'vite-plugin-eslint'
import autoprefixer from 'autoprefixer'
import packageJSON from './package.json'
import fs from 'fs'

fs.writeFileSync('src/version.ts', `export default '${packageJSON.version}'`)

export default defineConfig({
plugins: [react(), eslint()],
Expand Down

0 comments on commit 6a015ba

Please sign in to comment.