Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
fix(Thema): Simplify Thema version resolution logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Apr 7, 2020
1 parent 6c09dcb commit 31ce7d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/browser/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { themes } from '../themes'
import { version } from '../../package.json'

export { themes }

Expand All @@ -7,8 +8,7 @@ export interface ThemaAssets {
scripts: string[]
}

const themaVersion = process.env.VERSION ?? '1'
const themaMajor = themaVersion.split('.')[0]
const themaMajor = version.split('.')[0]

/**
* The path to a theme in this package
Expand Down
6 changes: 1 addition & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const globby = require('globby')
const path = require('path')
const pkgJson = require('./package.json')

const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const FileManagerPlugin = require('filemanager-webpack-plugin')
Expand Down Expand Up @@ -103,10 +102,7 @@ module.exports = (env = {}, { mode }) => {
new CleanWebpackPlugin(),
new DefinePlugin({
'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.VERSION': JSON.stringify(
process.env.VERSION || pkgJson.version
)
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new MiniCssExtractPlugin(),
...docsPlugins,
Expand Down

0 comments on commit 31ce7d0

Please sign in to comment.