mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
build: build for default only
This commit is contained in:
parent
2698cbaa6c
commit
2c9f74b5f8
2 changed files with 8 additions and 3 deletions
|
|
@ -12,6 +12,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"dev": "VERSION=dev-v$(node scripts/get-version.js) NODE_OPTIONS=--openssl-legacy-provider webpack-dashboard -- webpack --watch",
|
||||
"dev:all": "GITAKO_TARGET= yarn run dev",
|
||||
"debug-firefox": "web-ext run --source-dir=dist-firefox --keep-profile-changes --start-url https://github.com/EnixCoda/Gitako",
|
||||
"prepare": "husky install",
|
||||
"postinstall": "patch-package",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
|||
|
||||
const IN_PRODUCTION_MODE = process.env.NODE_ENV === 'production'
|
||||
|
||||
function createConfig({ envTarget }: { envTarget: 'default' | 'firefox' | 'safari' }) {
|
||||
type Target = 'default' | 'firefox' | 'safari'
|
||||
|
||||
function createConfig({ envTarget }: { envTarget: Target }) {
|
||||
const outputPath = {
|
||||
default: path.resolve(__dirname, 'dist'),
|
||||
firefox: path.resolve(__dirname, 'dist-firefox'),
|
||||
|
|
@ -196,9 +198,11 @@ function createConfig({ envTarget }: { envTarget: 'default' | 'firefox' | 'safar
|
|||
return webpackConfig
|
||||
}
|
||||
|
||||
const configs = (['default', 'firefox', 'safari'] as const).map(envTarget =>
|
||||
createConfig({ envTarget }),
|
||||
const gitakoTarget = process.env.GITAKO_TARGET ?? 'default'
|
||||
const enabledTargets = (['default', 'firefox', 'safari'] as Target[]).filter(
|
||||
target => !gitakoTarget || gitakoTarget === target,
|
||||
)
|
||||
const configs = enabledTargets.map(envTarget => createConfig({ envTarget }))
|
||||
|
||||
// Enable parallelism for faster build
|
||||
// https://webpack.js.org/configuration/configuration-types/#parallelism
|
||||
|
|
|
|||
Loading…
Reference in a new issue