webpack.config.js 618 B

123456789101112131415161718192021222324252627282930
  1. const path = require("path");
  2. module.exports = {
  3. mode: "production",
  4. devtool: "source-map",
  5. entry: "./src/tc_vod.ts",
  6. module: {
  7. rules: [
  8. {
  9. test: /\.ts$/,
  10. use: "ts-loader",
  11. exclude: /node_modules/
  12. }
  13. ]
  14. },
  15. resolve: {
  16. extensions: [".ts", ".js"]
  17. },
  18. optimization: {
  19. // 这个选项开启后会影响 ts sourcemap 的生成,调试了半天也不懂是为什么。
  20. occurrenceOrder: false
  21. },
  22. output: {
  23. filename: "vod-js-sdk-v6.js",
  24. path: path.resolve(__dirname, "dist"),
  25. library: "TcVod",
  26. libraryTarget: "umd"
  27. },
  28. plugins: []
  29. };