migrating cjs -> esm

This commit is contained in:
2024-10-07 20:48:28 +03:00
parent b91c95bde3
commit 3609a154a9
8 changed files with 27 additions and 18 deletions

View File

@@ -1,9 +1,13 @@
const path = require("path");
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");
import path from "path";
import { fileURLToPath } from "url";
import webpack from "webpack";
import TerserPlugin from "terser-webpack-plugin";
module.exports = {
entry: "./index.js",
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
entry: "./dist/index.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist")