squiggle/packages/components/webpack.config.js

54 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2022-03-23 00:38:01 +00:00
const path = require("path");
2022-03-21 23:40:14 +00:00
module.exports = {
2022-03-23 00:38:01 +00:00
mode: "production",
devtool: "source-map",
profile: true,
entry: "./src/index.ts",
2022-03-21 23:40:14 +00:00
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: { projectReferences: true },
2022-03-21 23:40:14 +00:00
exclude: /node_modules/,
},
],
},
resolve: {
2022-03-23 00:38:01 +00:00
extensions: [".js", ".tsx", ".ts"],
alias: {
2022-04-04 06:58:05 +00:00
"@quri/squiggle-lang": path.resolve(__dirname, "../squiggle-lang/src/js"),
},
2022-03-21 23:40:14 +00:00
},
output: {
2022-03-23 00:38:01 +00:00
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
2022-03-21 23:40:14 +00:00
library: {
2022-03-23 00:38:01 +00:00
name: "squiggle_components",
type: "umd",
2022-03-21 23:40:14 +00:00
},
},
2022-03-22 02:33:28 +00:00
devServer: {
static: {
2022-03-23 00:38:01 +00:00
directory: path.join(__dirname, "public"),
2022-03-22 02:33:28 +00:00
},
compress: true,
port: 9000,
},
externals: {
2022-06-18 11:14:01 +00:00
react: {
commonjs: "react",
commonjs2: "react",
amd: "react",
root: "React",
},
"react-dom": {
commonjs: "react-dom",
commonjs2: "react-dom",
amd: "react-dom",
root: "ReactDOM",
},
},
2022-03-21 23:40:14 +00:00
};