SocialvoidJS/webpack.config.js

33 lines
692 B
JavaScript

// Generated using webpack-cli https://github.com/webpack/webpack-cli
const path = require("path");
const isProduction = process.env.NODE_ENV == "production";
const config = {
target: "web",
entry: "./dist/mod.js",
output: {
library: "socialvoid",
filename: "socialvoid.js",
path: path.resolve(__dirname, "out"),
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
fallback: {
fs: false,
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
},
},
};
module.exports = () => {
if (isProduction) {
config.mode = "production";
} else {
config.mode = "development";
}
return config;
};