mirror of
https://github.com/jakejarvis/dark-mode.git
synced 2025-04-25 14:05:22 -04:00
39 lines
854 B
JavaScript
39 lines
854 B
JavaScript
const webpack = require("webpack");
|
|
const path = require("path");
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
|
|
module.exports = {
|
|
mode: "production",
|
|
entry: "./src/index.js",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: "index.js",
|
|
library: {
|
|
name: "darkMode",
|
|
type: "umd",
|
|
},
|
|
globalObject: "this",
|
|
},
|
|
plugins: [
|
|
new webpack.BannerPlugin({
|
|
banner: "Dark mode switcheroo | MIT License | jrvs.io/darkmode",
|
|
}),
|
|
new CopyPlugin({
|
|
patterns: [
|
|
{
|
|
from: path.join(__dirname, "src/index.d.ts"),
|
|
to: path.join(__dirname, "dist", "index.d.ts"),
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
optimization: {
|
|
minimizer: [
|
|
new TerserPlugin({
|
|
extractComments: false,
|
|
}),
|
|
],
|
|
},
|
|
};
|