isoflow/webpack/prod.config.js

52 lines
1,017 B
JavaScript
Raw Normal View History

2023-03-16 21:27:09 +00:00
const path = require("path");
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2023-03-16 21:27:09 +00:00
module.exports = {
mode: "production",
entry: "./src/Isoflow.tsx",
2023-03-16 21:27:09 +00:00
output: {
2023-03-24 23:32:36 +00:00
path: path.resolve(__dirname, "../dist"),
2023-03-16 21:27:09 +00:00
filename: "index.js",
libraryTarget: "commonjs2",
},
externals: {
react: {
commonjs: "react",
commonjs2: "react",
amd: "React",
root: "React",
},
"react-dom": {
commonjs: "react-dom",
commonjs2: "react-dom",
amd: "ReactDOM",
root: "ReactDOM",
},
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: "ts-loader",
exclude: /node_modules/,
},
2023-07-12 11:16:52 +00:00
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.svg$/,
use: [
{
loader: 'svg-url-loader'
},
],
},
2023-03-16 21:27:09 +00:00
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
plugins: [new TsconfigPathsPlugin()]
2023-03-16 21:27:09 +00:00
},
};