microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
749865d4258b084443a56bffcfa490ef2cdbe80d

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

ts/examples/viewMarkdown/webpack.config.js

49lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4import path from "node:path";
5import { fileURLToPath } from "node:url";
6import CopyPlugin from "copy-webpack-plugin";
7import { setupMiddlewares } from "./dist/route/route.js";
8
9const dirName = fileURLToPath(new URL(".", import.meta.url));
10const srcDir = path.join(dirName, "src");
11export default {
12 mode: "development",
13 devtool: "inline-source-map",
14 devServer: {
15 setupMiddlewares,
16 static: {
17 directory: path.join(dirName, "dist"),
18 },
19 compress: true,
20 port: 9001,
21 },
22 entry: {
23 index: path.join(srcDir, "site", "index.ts"),
24 },
25 output: {
26 path: path.join(dirName, "dist"),
27 filename: "[name].js",
28 },
29 module: {
30 rules: [
31 {
32 test: /\.tsx?$/,
33 use: "ts-loader",
34 exclude: /node_modules/,
35 },
36 ],
37 },
38 resolve: {
39 extensions: [".tsx", ".ts", ".js"],
40 },
41 plugins: [
42 new CopyPlugin({
43 patterns: [
44 { from: path.join(srcDir, "site", "index.html"), to: "." },
45 { from: path.join(srcDir, "site", "styles.css"), to: "." },
46 ],
47 }),
48 ],
49};
50