voice-changer/client/lib/webpack.common.js

43 lines
1014 B
JavaScript
Raw Normal View History

2023-01-04 20:28:36 +03:00
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: "./src/index.ts",
resolve: {
extensions: [".ts", ".js"],
2023-02-18 14:53:15 +03:00
fallback: {
2023-03-15 00:39:33 +03:00
"buffer": require.resolve("buffer/")
2023-02-18 14:53:15 +03:00
}
2023-01-04 20:28:36 +03:00
},
module: {
rules: [
{
test: [/\.ts$/, /\.tsx$/],
use: [
{
loader: "ts-loader",
options: {
configFile: "tsconfig.json",
},
},
],
},
],
},
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),
libraryTarget: "umd",
globalObject: "typeof self !== 'undefined' ? self : this",
},
2023-03-15 00:39:33 +03:00
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
2023-01-12 17:01:45 +03:00
externals: {
react: "react",
"react-dom": "reactDOM",
}
2023-01-04 20:28:36 +03:00
};