webpack.config.babel.js 995 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import path from "node:path";
  2. export default {
  3. entry: path.resolve(__dirname, "main.js"),
  4. output: {
  5. path: path.resolve(__dirname, "dist"),
  6. filename: "[name].js",
  7. library: "vcat",
  8. libraryTarget: 'umd',
  9. globalObject: 'this',
  10. clean:true
  11. },
  12. module: {
  13. rules: [
  14. {
  15. test: /\.(ts|js)x?$/,
  16. exclude: /(node_modules)/,
  17. use: {
  18. loader: "babel-loader",
  19. options: {
  20. presets: ["@babel/preset-env", "@babel/preset-typescript"],
  21. },
  22. },
  23. },
  24. {
  25. test: /\.csv$/,
  26. use: [
  27. {
  28. loader: path.resolve(__dirname, "i18n_csv_loader"),
  29. },
  30. ],
  31. exclude: /node_modules/,
  32. },
  33. ],
  34. },
  35. resolve: {
  36. extensions: [".tsx", ".ts", ".js", ".csv"],
  37. fallback: {
  38. fs: false,
  39. },
  40. },
  41. stats: {
  42. colors: true,
  43. },
  44. devtool: "source-map",
  45. watchOptions: {
  46. ignored: [path.resolve(__dirname, ".ima_version.json")],
  47. },
  48. };