Follow-up from https://github.com/webrecorder/browsertrix-cloud/pull/1546#discussion_r1529001599 (cc @SuaYoo) - Adds `eslint-plugin-import-x` and `@ianvs/prettier-plugin-sort-imports` and configures rules for them both so imports get sorted on format & on lint. - Runs both on everything!
		
			
				
	
	
		
			19 lines
		
	
	
		
			604 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			604 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Serve app locally without building with webpack, e.g. for e2e
 | |
| const connectHistoryApiFallback = require("connect-history-api-fallback");
 | |
| const express = require("express");
 | |
| const { createProxyMiddleware } = require("http-proxy-middleware");
 | |
| 
 | |
| const devServerConfig = require("../config/dev-server.js");
 | |
| 
 | |
| const app = express();
 | |
| 
 | |
| devServerConfig.onBeforeSetupMiddleware({ app });
 | |
| 
 | |
| app.use("/", express.static("dist"));
 | |
| Object.keys(devServerConfig.proxy).forEach((path) => {
 | |
|   app.use(path, createProxyMiddleware(devServerConfig.proxy[path]));
 | |
| });
 | |
| app.use(connectHistoryApiFallback());
 | |
| 
 | |
| app.listen(9871);
 |