webpack.main.config.ts 807 B

1234567891011121314151617181920212223242526272829303132
  1. import type { Configuration } from "webpack";
  2. import path from "path";
  3. import { rules } from "./webpack.rules";
  4. export const mainConfig: Configuration = {
  5. /**
  6. * This is the main entry point for your application, it's the first file
  7. * that runs in the main process.
  8. */
  9. entry: {
  10. index: "./src/main/index.ts",
  11. },
  12. // Put your normal webpack config below here
  13. module: {
  14. rules,
  15. },
  16. resolve: {
  17. extensions: [".js", ".ts", ".jsx", ".tsx", ".css", ".json", '.node'],
  18. alias: {
  19. "@": path.join(__dirname, "../src"),
  20. "@main": path.join(__dirname, "../src/main"),
  21. "@native": path.join(__dirname, "../src/main/native_modules"),
  22. "@shared": path.join(__dirname, "../src/shared")
  23. },
  24. },
  25. output: {
  26. filename: "[name].js",
  27. },
  28. externals: ['sharp']
  29. };