<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gregminster</author_name>
  <author_url>https://blog.hatena.ne.jp/gregminster/</author_url>
  <blog_title>約束の地</blog_title>
  <blog_url>https://obel.hatenablog.jp/</blog_url>
  <categories>
    <anon>プログラミング -&gt; 言語 -&gt; JavaScript</anon>
  </categories>
  <description>結論 webpack.config.js に target: 'node' を追加します。例えば以下のようになります。 module.exports = { （省略） target: 'node', （省略） }; 補足 fs はサーバサイド用のライブラリなので、フロントエンド（Webブラウザ）では一般的には用いません。この解決方法も、サーバサイドで node を用いる場合の解決方法です。 webpack を用いるときにはこの点も意識しておく必要があると思います。 感想 webpack 難しすぎ……。 参考</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobel.hatenablog.jp%2Fentry%2F20200308%2F1583605800&quot; title=&quot;webpack で bundle したファイル内で fs を用いる方法 - 約束の地&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>https://raw.githubusercontent.com/webpack/media/master/logo/icon-square-big.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-03-08 03:30:00</published>
  <title>webpack で bundle したファイル内で fs を用いる方法</title>
  <type>rich</type>
  <url>https://obel.hatenablog.jp/entry/20200308/1583605800</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
