<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>madogiwa0124</author_name>
  <author_url>https://blog.hatena.ne.jp/madogiwa0124/</author_url>
  <blog_title>Madogiwa Blog</blog_title>
  <blog_url>https://madogiwa0124.hatenablog.com/</blog_url>
  <categories>
    <anon>JavaScript</anon>
    <anon>開発</anon>
  </categories>
  <description>Viteのdefineを使ってGlobalな定数を定義するのにちょっとハマったのでメモ📝 例えばViteの実行時にしていたmodeに合わせてNODE_ENVのような定数をグローバルに定義したい場合は以下のようにすればOKです👍 export default defineConfig(({ command, mode }) =&gt; { define: { NODE_ENV: `&quot;${mode}&quot;`, }, }; }); 文字列を渡したとしても明示的にセミコロンを付与してあげる必要があるようです。 文字列の値は純粋な式として評価されるので、文字列の定数を定義する場合は、明示的に引用符で囲う必要があり…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmadogiwa0124.hatenablog.com%2Fentry%2F2022%2F12%2F03%2F134920&quot; title=&quot;Viteのdefineを使ってGlobalな定数を定義する - Madogiwa Blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-12-03 13:49:20</published>
  <title>Viteのdefineを使ってGlobalな定数を定義する</title>
  <type>rich</type>
  <url>https://madogiwa0124.hatenablog.com/entry/2022/12/03/134920</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
