view webpack.config.js @ 32:db0e9cbf52e5

WIP converting to the package system that i found can work
author drewp@bigasterisk.com
date Tue, 24 Dec 2019 18:37:03 -0800
parents 86270a59ae7b
children
line wrap: on
line source

const path = require("path");

const thisPackage = path.basename(__dirname) 
module.exports = {
  entry: ["./src/index.ts"],
  output: {
    library: thisPackage,
    filename: "bundle.js",
    path: path.resolve(__dirname, "build"),
    publicPath: "/build/"
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        loader: require.resolve("ts-loader")
      },
      { test: /\.css$/i, use: ["file-loader"] }
    ]
  },
  devtool: "source-map",
  resolve: {
    extensions: [".ts", ".js"],
    modules: ["node_modules"]
  },
  watchOptions: {
    ignored: /node_modules/,
    poll: 200
  },
  devServer: {
    port: 8082,
    publicPath: "/build/",
    contentBase: __dirname
  }
};