4e421e6e9e
Co-authored-by: Lipis <lipiridis@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com>
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
const webpack = require("webpack");
|
|
const path = require("path");
|
|
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
|
|
.BundleAnalyzerPlugin;
|
|
|
|
module.exports = {
|
|
mode: "production",
|
|
entry: { "excalidraw-utils.min": "./index.js" },
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: "[name].js",
|
|
library: "ExcalidrawUtils",
|
|
libraryTarget: "umd",
|
|
},
|
|
resolve: {
|
|
extensions: [".tsx", ".ts", ".js", ".css", ".scss"],
|
|
},
|
|
optimization: {
|
|
runtimeChunk: false,
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(sa|sc|c)ss$/,
|
|
exclude: /node_modules/,
|
|
use: ["style-loader", { loader: "css-loader" }, "sass-loader"],
|
|
},
|
|
{
|
|
test: /\.(ts|tsx|js)$/,
|
|
use: [
|
|
{
|
|
loader: "ts-loader",
|
|
options: {
|
|
transpileOnly: true,
|
|
configFile: path.resolve(__dirname, "../tsconfig.prod.json"),
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new webpack.optimize.LimitChunkCountPlugin({
|
|
maxChunks: 1,
|
|
}),
|
|
...(process.env.ANALYZER === "true" ? [new BundleAnalyzerPlugin()] : []),
|
|
],
|
|
};
|