excalidraw/src/packages/utils/webpack.prod.config.js

41 lines
813 B
JavaScript
Raw Normal View History

2020-11-02 20:14:20 +01:00
const webpack = require("webpack");
const path = require("path");
module.exports = {
mode: "production",
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
optimization: {
runtimeChunk: false,
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "excalidraw-utils.min.js",
library: "ExcalidrawUtils",
libraryTarget: "umd",
},
entry: "./index.js",
module: {
rules: [
{
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,
}),
],
};