Skip to content

Commit

Permalink
chore: update env
Browse files Browse the repository at this point in the history
  • Loading branch information
iosh committed Aug 14, 2024
1 parent e664e27 commit 61b2757
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 1 addition & 6 deletions packages/inner-utils/env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import browser from 'webextension-polyfill'
import packageJson from '../../package.json'

export const MODE = import.meta.env
? import.meta.env.NODE_ENV
: process.env.NODE_ENV
Expand All @@ -9,6 +6,4 @@ export const IS_DEV_MODE = MODE === 'development'
export const IS_PROD_MODE = MODE === 'production'
export const IS_CI = process.env.CI === 'true'

export const PACKAGE_VERSION = packageJson.version

export const isManifestV3 = browser.runtime.getManifest().manifest_version === 3
export const PACKAGE_VERSION = process.env.PACKAGE_VERSION
3 changes: 3 additions & 0 deletions packages/service-worker/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import browser from 'webextension-polyfill'

export const isManifestV3 = browser.runtime.getManifest().manifest_version === 3
3 changes: 2 additions & 1 deletion scripts/webpack.config.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('node:path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const WextManifestWebpackPlugin = require('wext-manifest-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
const {ProvidePlugin} = require('webpack')
const {ProgressPlugin} = require('webpack')
const {EsbuildPlugin} = require('esbuild-loader')
const packageJson = require('../package.json')
const packagesPath = path.join(path.resolve(), './packages')
const devMode = process.env.NODE_ENV !== 'production'

Expand Down Expand Up @@ -130,6 +130,7 @@ const defaultConfig = {
'process.env.SENTRY_DSN': JSON.stringify(
process.env.SNOWPACK_PUBLIC_SENTRY_DSN || '',
),
'process.env.PACKAGE_VERSION': packageJson.version,
},
}),
// Plugin to not generate js bundle for manifest entry
Expand Down

0 comments on commit 61b2757

Please sign in to comment.