You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
868 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. const path = require("path");
  2. const webpack = require("webpack");
  3. module.exports = {
  4. devServer: {
  5. port: 9000,
  6. static: {
  7. directory: path.join(__dirname, "dist"),
  8. },
  9. },
  10. devtool: "inline-source-map",
  11. entry: ["./lib/index.ts"],
  12. mode: process.env.NODE_ENV === "production" ? "production" : "development",
  13. module: {
  14. rules: [
  15. {
  16. test: /\.ts$/,
  17. exclude: /node_modules/,
  18. use: "ts-loader",
  19. },
  20. {
  21. test: /\.(frag|vert)$/,
  22. type: "asset/source",
  23. },
  24. ],
  25. },
  26. output: {
  27. path: path.join(__dirname, "dist", "build"),
  28. publicPath: "/build",
  29. filename: "bundle.js",
  30. },
  31. performance: {
  32. maxEntrypointSize: 512000,
  33. maxAssetSize: 512000,
  34. },
  35. plugins: [new webpack.EnvironmentPlugin({ NODE_ENV: "development" })],
  36. resolve: {
  37. extensions: [".js", ".ts"],
  38. },
  39. };