Skip to content
Snippets Groups Projects
Select Git revision
  • fd5cf329bdece1ebb807d2fbcaf567ddcca7b1df
  • develop default
  • master protected
  • feature/frontend-tests
  • 0.99
  • 0.98
  • 0.97
  • 0.96
  • 0.95
  • 0.94
  • 0.93
  • 0.92
  • 0.91
  • 0.90
  • 0.89
  • 0.88
  • 0.87
  • 0.86
  • 0.85
  • 0.84
  • 0.83
  • 0.82
  • 0.81
  • 0.80
24 results

mapping.py

Blame
  • webpack.config.ts 2.44 KiB
    import path from "path";
    import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin";
    
    import { Configuration as WebpackConfiguration } from "webpack";
    import { Configuration as WebpackDevServerConfiguration } from "webpack-dev-server";
    
    interface Configuration extends WebpackConfiguration {
      devServer?: WebpackDevServerConfiguration;
    }
    
    const config: Configuration = {
      entry: "./src/index.tsx",
      module: {
        rules: [
          {
            test: /\.(ts|js)x?$/,
            exclude: /node_modules/,
            use: {
              loader: "babel-loader",
              options: {
                presets: [
                  "@babel/preset-env",
                  "@babel/preset-react",
                  "@babel/preset-typescript",
                ],
              },
            },
          },
          {
            test: /\.scss$/,
            exclude: /node_modules/,
            use: [
              { loader: "style-loader" },
              { loader: "css-loader" },
              { loader: "sass-loader" },
            ],
          },
          {
            test: /\.css$/,
            use: [{ loader: "style-loader" }, { loader: "css-loader" }],
          },
          {
            test: /\.(png|svg|jpe?g|gif)$/,
            include: /images/,
            use: [
              {
                loader: "file-loader",
                options: {
                  name: "[name].[ext]",
                  outputPath: "images/"
                },
              },
              {
                loader: "image-webpack-loader",
                options: {
                  query: {
                    mozjpeg: {
                      progressive: true,
                    },
                    gifsicle: {
                      interlaced: true,
                    },
                    optipng: {
                      optimizationLevel: 7,
                    },
                  },
                },
              },
            ],
          },
        ],
      },
      resolve: {
        extensions: [".tsx", ".ts", ".js", ".html"],
      },
      output: {
        path: path.resolve(__dirname, "..", "compendium_v2", "static"),
        filename: "bundle.js",
      },
      devServer: {
        static: path.join(__dirname, "..", "compendium_v2", "static"),
        compress: true,
        port: 4000,
        // Allow SPA urls to work with dev-server
        historyApiFallback: true,
        proxy: {
          "/api": "http://127.0.0.1:5000",
          "/login": "http://127.0.0.1:5000",
          "/logout": "http://127.0.0.1:5000",
          "/authorize": "http://127.0.0.1:5000",
          "/survey/*": "http://127.0.0.1:4001"
        },
      },
      plugins: [
        new ForkTsCheckerWebpackPlugin({
          async: false,
        }),
      ],
    };
    
    export default config;