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
/* | |
Split webpack config into multiple files | |
*/ | |
var requireDir = require('require-dir'); | |
// Require the webpack.config directory | |
var configs = requireDir('./webpack.configs'); | |
// Lets export the config | |
module.exports = configs.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
// Initialize config object | |
var config = {}; | |
module.exports = 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
// Entry module/file for webpack | |
var config = require('./config.js'); | |
config.entry = '../main.js'; |
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 config = require('./config.js'); | |
// Main output directory and file for bundled js | |
config.output = { | |
path: './dist', | |
filename: 'bundle.js' | |
}; |
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
// Initialize plugins for webpack | |
var config = require('./config.js'); | |
var webpack = require('webpack'); | |
// Define empty plugins array | |
config.plugins = [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.UglifyJsPlugin({ /* can pass many options */ }) | |
]; |
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 config = require('./config.js'); | |
var nodeExternals = require('webpack-node-externals'); | |
// Ignore node_modules/* so all modules won't get bundled and include | |
// only whitelisted modules in bundle | |
config.externals = [nodeExternals({ | |
whitelist: ['require', 'webpack', 'jquery'] | |
})]; |
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 config = require('./config.js'); | |
// SourceMap generation | |
config.devtool = 'inline-source-map'; | |
// Directory context | |
config.context = __dirname; | |
// Target environment | |
config.target = 'node'; |
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
/* | |
Mount and Unmount react components at nodes | |
*/ | |
/* global Turbolinks, ReactHelper */ | |
import ReactDOM from 'react-dom'; | |
import Relay from 'react-relay'; | |
import React from 'react'; |
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
module API | |
HTTPAdapter = GraphQL::Client::HTTP.new(ENV['API_URL']) | |
# | |
# Pass block to send auth token | |
# def headers(context) | |
# { | |
# "Authorization" => "Bearer #{ENV['ACCESS_TOKEN']}" | |
# } | |
# end |
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
IndexQuery = API::Client.parse <<-'GRAPHQL' | |
query { | |
root { | |
id, | |
tags, | |
posts(first: 10) { | |
edges { | |
node { | |
id, | |
title, |
OlderNewer