webpack.renderer.config.ts 704 B

1234567891011121314151617181920212223242526272829
  1. import type { Configuration } from "webpack";
  2. import { VanillaExtractPlugin } from "@vanilla-extract/webpack-plugin";
  3. import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
  4. import { rules } from "./webpack.rules";
  5. import { plugins } from "./webpack.plugins";
  6. rules.push({
  7. test: /\.css$/,
  8. use: [{ loader: "style-loader" }, { loader: "css-loader" }],
  9. });
  10. rules.push({
  11. test: /\.svg$/,
  12. use: ["@svgr/webpack"],
  13. });
  14. export const rendererConfig: Configuration = {
  15. module: {
  16. rules,
  17. },
  18. devtool: "source-map",
  19. plugins: [...plugins, new VanillaExtractPlugin()],
  20. resolve: {
  21. extensions: [".js", ".ts", ".jsx", ".tsx", ".css"],
  22. plugins: [new TsconfigPathsPlugin()],
  23. },
  24. };