voice-changer/client/lib/webpack.common.js
2023-03-15 06:39:33 +09:00

43 lines
1014 B
JavaScript

const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: "./src/index.ts",
resolve: {
extensions: [".ts", ".js"],
fallback: {
"buffer": require.resolve("buffer/")
}
},
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",
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
externals: {
react: "react",
"react-dom": "reactDOM",
}
};