2022-03-23 00:38:01 +00:00
|
|
|
const path = require("path");
|
2022-06-05 06:48:31 +00:00
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2022-03-21 23:40:14 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2022-03-23 00:38:01 +00:00
|
|
|
mode: "production",
|
|
|
|
devtool: "source-map",
|
2022-04-12 05:41:36 +00:00
|
|
|
profile: true,
|
2022-06-09 20:57:45 +00:00
|
|
|
entry: ["./src/index.ts", "./src/styles/main.css"],
|
2022-03-21 23:40:14 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
2022-03-24 23:27:17 +00:00
|
|
|
loader: "ts-loader",
|
2022-06-05 06:48:31 +00:00
|
|
|
options: { projectReferences: true },
|
2022-03-21 23:40:14 +00:00
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
2022-04-02 09:36:33 +00:00
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
2022-06-05 06:48:31 +00:00
|
|
|
use: [MiniCssExtractPlugin.loader, "css-loader", "postcss-loader"],
|
2022-04-02 09:36:33 +00:00
|
|
|
},
|
2022-03-21 23:40:14 +00:00
|
|
|
],
|
|
|
|
},
|
2022-06-05 06:48:31 +00:00
|
|
|
plugins: [new MiniCssExtractPlugin()],
|
2022-03-21 23:40:14 +00:00
|
|
|
resolve: {
|
2022-03-23 00:38:01 +00:00
|
|
|
extensions: [".js", ".tsx", ".ts"],
|
2022-03-24 23:27:17 +00:00
|
|
|
alias: {
|
2022-04-04 06:58:05 +00:00
|
|
|
"@quri/squiggle-lang": path.resolve(__dirname, "../squiggle-lang/src/js"),
|
2022-03-24 23:27:17 +00:00
|
|
|
},
|
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,
|
|
|
|
},
|
2022-03-21 23:40:14 +00:00
|
|
|
};
|