Skip to content

Instantly share code, notes, and snippets.

@johnstew
johnstew / webpack.config.js
Created January 28, 2017 18:47
basic webpack config
const path = require('path');
module.exports = {
entry: path.join(__dirname, 'index.js'),
output: {
filename: 'index.bundle.js',
path: path.join(__dirname, 'build')
}
};
@johnstew
johnstew / blog-webpack-2.md
Created January 18, 2017 13:14 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@johnstew
johnstew / gist:424cf77d3eb8e3907e541c0d3230f39f
Created November 2, 2016 16:26 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@johnstew
johnstew / .eslintrc
Created September 2, 2016 17:40
.eslintrc
{
"extends": ["airbnb"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react"],
@johnstew
johnstew / getset.js
Created August 22, 2016 20:51
JS getset
getset: function(model, prop, value) {
var last = model.get(prop);
if (value !== undefined) {
model.set(prop, value);
}
return last;
}
@johnstew
johnstew / webpack.config.js
Created February 26, 2016 21:57
Webpack Config
var webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: {
main: [
'./src/app.js',
'webpack-dev-server/client?http://localhost:8080'
]
},
@johnstew
johnstew / gulpfile.js
Created February 25, 2016 22:04
Gulp, Browserify, SASS
// jscs:disable
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var connect = require('gulp-connect');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
@johnstew
johnstew / gulpfile.js
Last active January 18, 2020 12:09
Gulp, Browserify, Multiple Entry Points
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var connect = require('gulp-connect');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
@johnstew
johnstew / gulpfile.js
Created December 1, 2015 21:45
Gulp setup with Swig.
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var swig = require('gulp-swig');
var clean = require('gulp-clean');
var connect = require('gulp-connect');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var imagemin = require('gulp-imagemin');
@johnstew
johnstew / funnyconditinal.html
Created January 21, 2015 14:43
Tesla IE Conditional for LTE IE7
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 wow-such-browser page-has-skinny-footer"> <![endif]-->