Skip to content

Instantly share code, notes, and snippets.

Mark Bradshaw mark-bradshaw

Block or report user

Report or block mark-bradshaw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mark-bradshaw
mark-bradshaw / requireThroughWebpack.js
Created Oct 8, 2015
Use an in-memory webpack compiler to get specific files or file trees.
View requireThroughWebpack.js
import _ from 'lodash';
import MemoryFileSystem from 'memory-fs';
import webpack from 'webpack';
import webpackConfig from '../../webpack.config';
// This function allows you to do an on-the-fly, in-memory webpack compile starting
// with whatever file entry point you want, and receive back the compiled object.
export default (entry, callback) => {
You can’t perform that action at this time.