Actually I have these configs and it does not work, so can you tell me what I'm doing wrong (of course I have "module": "ESNext", in my tsconfig) big thanks
const { join } = require("path");
const { BannerPlugin } = require("webpack");
const ThreadsPlugin = require('threads-plugin');
module.exports = {
mode: "production",
devtool: "source-map",
entry: {
main: "./src/index.ts"
},
output: {
path: join(__dirname, "lib"),
filename: "index.js",
library: "secrecy",
libraryTarget: "umd"
},
target: "web",
resolve: {
extensions: [".ts", ".tsx", ".js"],
fallback: {
crypto: false,
path: false
}
},
module: {
rules: [{ test: /\.tsx?$/, loader: "babel-loader" }]
},
plugins: [
new ThreadsPlugin(),
new BannerPlugin({
entryOnly: true,
raw: true,
banner: 'typeof window !== "undefined" &&'
}) // SSR/Node.js guard
]
};
{
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
"loose": true,
"modules": false,
"targets": "defaults"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/proposal-object-rest-spread",
[
"@babel/plugin-transform-runtime",
{
"regenerator": true
}
]
]
}
Actually I have these configs and it does not work, so can you tell me what I'm doing wrong (of course I have
"module": "ESNext",in my tsconfig) big thanks{ "presets": [ "@babel/preset-typescript", [ "@babel/preset-env", { "loose": true, "modules": false, "targets": "defaults" } ] ], "plugins": [ "@babel/plugin-proposal-class-properties", "@babel/proposal-object-rest-spread", [ "@babel/plugin-transform-runtime", { "regenerator": true } ] ] }