Skip to content
Snippets Groups Projects
webpack.config.js 823 B
Newer Older
  • Learn to ignore specific revisions
  • const path = require("path");
    const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
    
    module.exports = {
      entry: {
        "index": "./src/index.ts",
      },
      output: {
    
        path: path.resolve(__dirname, "web"),
    
        filename: "[name].js",
        libraryTarget: "umd",
        library: "UspJs",
        umdNamedDefine: true,
      },
      resolve: {
        extensions: [".ts", ".tsx", ".js"],
      },
      devtool: "source-map",
      optimization: {
        minimizer: [
          new UglifyJsPlugin({
            uglifyOptions: {
              minimize: true,
              sourceMap: true,
              include: /\.min\.js$/,
            },
          }),
        ],
      },
      module: {
        rules: [
          {
            test: /\.tsx?$/,
            loader: "awesome-typescript-loader",
            exclude: /node_modules/,
            query: {
              declaration: false,
            },
          },
        ],
      },
    };