deno.land / x / msgpack_javascript@v3.0.0-beta2 / example / webpack-example / webpack.config.ts
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162const path = require("path");const webpack = require("webpack");const _ = require("lodash");
const config = { mode: "production",
entry: "./index.ts", output: { path: path.resolve(__dirname, "dist"), filename: undefined, // will be set later }, resolve: { extensions: [".ts", ".tsx", ".mjs", ".js", ".json", ".wasm"], }, module: { rules: [ { test: /\.tsx?$/, loader: "ts-loader", options: { configFile: "tsconfig.json", }, }, ], },
plugins: [ new webpack.DefinePlugin({ // eslint-disable-next-line @typescript-eslint/naming-convention "process.env.TEXT_ENCODING": "undefined", // eslint-disable-next-line @typescript-eslint/naming-convention "process.env.TEXT_DECODER": "undefined", }), ],
optimization: { noEmitOnErrors: true, minimize: false, },
// We don't need NodeJS stuff on browsers! // https://webpack.js.org/configuration/node/ node: false,
devtool: "source-map",};
module.exports = [ ((config) => { config.output.filename = "bundle.min.js"; config.optimization.minimize = true; return config; })(_.cloneDeep(config)),
((config) => { config.output.filename = "bundle.js"; config.optimization.minimize = false; return config; })(_.cloneDeep(config)),];
Version Info