microsoft/TypeAgent
Publicmirrored from https://github.com/microsoft/TypeAgentAvailable
ts/examples/whisperClient/webpack.config.js
41lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | import path from "node:path"; |
| 5 | import { fileURLToPath } from "node:url"; |
| 6 | import CopyPlugin from "copy-webpack-plugin"; |
| 7 | |
| 8 | const dirName = fileURLToPath(new URL(".", import.meta.url)); |
| 9 | export default { |
| 10 | mode: "development", |
| 11 | devtool: "inline-source-map", |
| 12 | devServer: { |
| 13 | static: { |
| 14 | directory: path.join(dirName, "dist"), |
| 15 | }, |
| 16 | compress: true, |
| 17 | port: 9000, |
| 18 | }, |
| 19 | entry: path.resolve(dirName, "src", "index.ts"), |
| 20 | module: { |
| 21 | rules: [ |
| 22 | { |
| 23 | test: /\.tsx?$/, |
| 24 | use: "ts-loader", |
| 25 | exclude: /node_modules/, |
| 26 | }, |
| 27 | ], |
| 28 | }, |
| 29 | resolve: { |
| 30 | extensions: [".tsx", ".ts", ".js"], |
| 31 | }, |
| 32 | output: { |
| 33 | filename: "bundle.js", |
| 34 | path: path.resolve(dirName, "dist"), |
| 35 | }, |
| 36 | plugins: [ |
| 37 | new CopyPlugin({ |
| 38 | patterns: [{ from: ".", to: ".", context: "public" }], |
| 39 | }), |
| 40 | ], |
| 41 | }; |
| 42 | |