Skip to content

Commit

Permalink
Update esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorstrate committed May 12, 2021
1 parent ca75190 commit f6debc1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
9 changes: 7 additions & 2 deletions ui/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ const bs = browserSync.create()
const production = process.env.NODE_ENV == 'production'
const watchMode = process.argv[2] == 'watch'

const ENVIRONMENT_VARIABLES = ['NODE_ENV', 'PHOTOVIEW_API_ENDPOINT', 'VERSION', 'BUILD_DATE', 'COMMIT_SHA']
const ENVIRONMENT_VARIABLES = [
'NODE_ENV',
'PHOTOVIEW_API_ENDPOINT',
'VERSION',
'BUILD_DATE',
'COMMIT_SHA',
]

const defineEnv = ENVIRONMENT_VARIABLES.reduce((acc, key) => {
acc[`process.env.${key}`] = process.env[key] ? `"${process.env[key]}"` : null
Expand All @@ -31,7 +37,6 @@ const esbuildOptions = {
format: 'esm',
bundle: true,
platform: 'browser',
target: ['chrome58', 'firefox57', 'safari11', 'edge16'],
splitting: true,
minify: production,
sourcemap: !production,
Expand Down
14 changes: 7 additions & 7 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"connect-history-api-fallback": "^1.6.0",
"copy-to-clipboard": "^3.3.1",
"dotenv": "^8.2.0",
"esbuild": "^0.8.52",
"esbuild": "^0.11.20",
"esbuild-plugin-babel": "^0.2.3",
"eslint": "^7.26.0",
"eslint-plugin-jest": "^24.3.6",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="/src/index.css" />
<link rel="stylesheet" href="/index.css" />

<!-- Apple touch devices -->
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png" />
Expand All @@ -14,6 +14,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.js"></script>
<script type="module" src="/index.js"></script>
</body>
</html>

0 comments on commit f6debc1

Please sign in to comment.