@zootools/waitlist-js
Version:
Viral whitelists / waitlists for nfts and web3 projects
64 lines (58 loc) • 1.49 kB
JavaScript
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const webpack = require("webpack");
// const CopyPlugin = require('copy-webpack-plugin')
const mode =
process.env.NODE_ENV === "production" ? "production" : "development";
const isProd = mode === "production";
const baseConfig = {
mode,
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
module: {
rules: [{ test: /\.tsx?$/, loader: "ts-loader" }],
},
plugins: [
// new CopyPlugin({
// patterns: [
// {
// from: 'src/css/*.scss',
// to: 'css/[name].css',
// transform: (content, path) => {
// const result = sass.renderSync({
// file: path,
// outputStyle: isProd ? 'compressed' : 'expanded',
// })
// return result.css.toString()
// },
// },
// ],
// }),
new webpack.DefinePlugin({
"process.env": {
CSS_URL: JSON.stringify(
isProd ? "https://embed.typeform.com/next/css/" : "./lib/css/"
),
},
}),
],
};
const browserConfig = {
...baseConfig,
entry: "./src/browser.ts",
output: {
filename: "index.min.js",
library: "tf",
libraryTarget: "window",
path: path.resolve(__dirname, "dist/browser"),
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin({ parallel: true })],
},
externalsType: "window",
};
module.exports = [
browserConfig
];