ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
webpack/template/webpack.common.js
const path = require('path');

const HtmlWebpackPlugin = require('html-webpack-plugin');

const distDir = path.resolve(__dirname, 'dist');

module.exports = {
  devServer: {
    contentBase: distDir,
    compress: true,
    port: 9000,
  },
  entry: './index.js',
  module: {
    rules: [
      {
        test: /\.(scss|css)$/,
        use: ['style-loader', 'css-loader', 'sass-loader'],
      },
      // Load fonts for KaTeX fonts.
      // https://webpack.js.org/guides/asset-management/
      {
        test: /\.(woff|woff2|eot|ttf|otf)$/i,
        type: 'asset/resource',
      },
    ],
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      // Inject the include to our hashed filename,
      // since it is not deterministic due to the hash.
      inject: true,
      template: path.resolve(__dirname, 'index.html'),
    }),
  ],
  output: {
    clean: true,
    // Add a hash to the file so that browsers can cache agressively.
    filename: '[name].[contenthash].js',
    path: distDir,

    // This will allow us to use exports of index.js on the browser
    // through the my_library_name UMD variable.
    library: 'my_library_name',
    libraryTarget: 'umd',
  },
};