webpack.main.config.ts 752 B

12345678910111213141516171819202122232425262728293031
  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. },
  23. },
  24. output: {
  25. filename: "[name].js",
  26. },
  27. externals: ['sharp']
  28. };