Skip to content

Instantly share code, notes, and snippets.

View sudarshang's full-sized avatar

Sudarshan Gaikaiwari sudarshang

View GitHub Profile
@sudarshang
sudarshang / static.config.js
Created May 20, 2018 18:37
react-static moo.do blog config.js (copy pasted from react-static slack)
import webpack from 'webpack';
import React, { Component } from 'react';
import { reloadRoutes } from 'react-static/node';
import jdown from 'jdown';
import chokidar from 'chokidar';
import path, { dirname } from 'path';
import RSS from 'rss';
import fs from 'fs';
var isDev = process.env.REACT_STATIC_ENV === 'development';
7a8
> <link rel="preload" as="script" href="/bootstrap.474eaeba.js">
9,16c10,13
< "/templates/styles.65f7d673.js">
< <link rel="preload" as="script" href=
< "/templates/vendors~main.6810fa37.js">
< <link rel="preload" as="script" href="/main.b47b78f3.js">
< <link rel="preload" as="script" href=
< "/templates/src/containers/Home.e0dd5fbb.js">
< <link rel="preload" as="style" href="/styles.65f7d673.css">
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.6.0">
<meta charset="UTF-8">
<title data-react-helmet="true"></title>
<link rel="preload" as="script" href=
"/templates/styles.65f7d673.js">
<link rel="preload" as="script" href=
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.6.0">
<meta charset="UTF-8">
<title data-react-helmet="true"></title>
<link rel="preload" as="script" href="/bootstrap.474eaeba.js">
<link rel="preload" as="script" href=
"/templates/src/containers/Home.07880ce7.js">
<html lang="en-US" class="gr__localhost">
<head>
<title data-react-helmet="true"></title>
<link rel="preload" as="script" href="/bootstrap.474eaeba.js">
<link rel="preload" as="script" href="/templates/src/containers/About.393ad3ad.js">
<link rel="preload" as="script" href="/main.0a31866b.js">
<link rel="preload" as="style" href="/styles.48985e8e.css">
<link rel="stylesheet" href="/styles.48985e8e.css">
<meta charset="UTF-8">
- await poolAll(
+ await Promise.all(
config.routes.map(route => async () => {
+ /* eslint-disable no-debugger */
+ debugger
+
@sudarshang
sudarshang / index.html
Created May 12, 2018 20:43
react-static generated webpack 4 generated html
<!DOCTYPE html>
<html lang="en-US">
<head>
<title data-react-helmet="true"></title>
<link rel="preload" as="script" href="/main.7e57ceeb.js" />
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
</head>
Building algolia
Building animated-routes
Building apollo
Building apollo-redux
"scripts": {
"debug": "node --inspect --inspect-brk ./node_modules/webpack/bin/webpack.js",
"prod:debug": "npm run debug -- --env.mode production",
"dev:debug": "npm run debug -- --env.mode development"
},
@sudarshang
sudarshang / package.json
Created May 10, 2018 15:47
Command to enable bundle analysis
"scripts": {
"webpack": "webpack",
"prod": "npm run webpack -- --env.mode production",
"prod:analyze": "npm run prod -- --env.presets analyze",
},