UNPKG

recent-searches

Version:

A JavaScript module to help anyone easily build recent searches functionality into their search.

48 lines (45 loc) 983 B
const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); const baseConfig = targetOptions => ({ target: "web", entry: { index: "./lib/index.ts", "index.min": "./lib/index.ts" }, output: { filename: targetOptions.libraryTarget === "umd" ? `./[name].js` : `./[name].${targetOptions.libraryTarget}.js`, library: "RecentSearches", umdNamedDefine: true, globalObject: `(typeof self !== 'undefined' ? self : this)`, ...targetOptions }, mode: "production", devtool: "source-map", module: { rules: [ { test: /\.ts$/, use: ["babel-loader"] } ] }, optimization: { minimize: true, minimizer: [ new UglifyJsPlugin({ include: /\.min\.js$/, uglifyOptions: { output: { comments: false } } }) ] }, resolve: { extensions: [".ts", ".js"] } }); module.exports = [baseConfig({ libraryTarget: "umd" })];