This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('babel-register'); | |
module.exports = require('./webpack.client'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const version = 'v0.01::'; | |
const staticCacheName = version + 'static'; | |
function updateStaticCache() { | |
return caches.open(staticCacheName) | |
.then( cache => { | |
// These items won't block the installation of the Service Worker | |
cache.addAll([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webpack from 'webpack'; | |
export default function(name, doneMessage){ | |
return new webpack.ProgressPlugin(function(percentage, message) { | |
var MOVE_LEFT = new Buffer('1b5b3130303044', 'hex').toString(); | |
var CLEAR_LINE = new Buffer('1b5b304b', 'hex').toString(); | |
process.stdout.write(CLEAR_LINE + 'webpack compiling ['+name+']: ' + Math.round(percentage * 100) + '%: ' + message + MOVE_LEFT); | |
if(percentage == 1){ | |
process.stdout.write(doneMessage || "webpack say good, fire up...\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WebpackDevMiddleware = require('webpack-dev-middleware'); | |
var WebpackHotMiddleware = require('webpack-hot-middleware'); | |
var historyApiFallback = require('connect-history-api-fallback'); | |
var express = require('express'); | |
var webpack = require('webpack'); | |
var config = require('./webpack.config.dev'); | |
var app = express(); | |
var compiler = webpack(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OPTIONS = { | |
credentials: 'include', | |
headers: { | |
'Accept': 'application/json', // eslint-disable-line | |
'Content-Type': 'application/json', | |
'X-Requested-With': 'XMLHttpRequest' | |
} | |
}; | |
export function parseResponse(response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default typeof window !== 'undefined' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (process.env.NODE_ENV && process.env.NODE_ENV === 'development') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import IS_DEV from '../src/server/utils/isDev'; | |
const hash = IS_DEV ? '[name]' : '[name]-[chunkhash]'; | |
new webpack.DefinePlugin({ | |
'IS_BROWSER': true, | |
'IS_DEV': IS_DEV, | |
'process.env.NODE_ENV': JSON.stringify(IS_DEV ? 'development' : 'production') | |
}), | |
output: { | |
path: path.join(root, '/build/assets'), | |
publicPath, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gobble = require('gobble') | |
const nodeResolve = require('rollup-plugin-node-resolve') | |
const commonjs = require('rollup-plugin-commonjs') | |
const replace = require('rollup-plugin-replace') | |
const babel = require('rollup-plugin-babel') | |
const uglify = require('rollup-plugin-uglify') | |
const autoprefixer = require('autoprefixer') | |
const cssnano = require('cssnano') | |
const pkg = require('./package') | |
const purifycss = require('purify-css') |