Skip to content

Commit dbd8b03

Browse files
committed
transform your bundles with browserify
1 parent a586dc9 commit dbd8b03

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Transform Your Bundles With Browserify
2+
3+
> [http://youtu.be/Uk2bgp8OLT8](http://youtu.be/Uk2bgp8OLT8)
4+
5+
Install [io.js](https://iojs.org/en/index.html).
6+
7+
Within this folder run the terminal command `npm install` to install the
8+
`dependencies` and `devDependencies`.
9+
10+
Then run `npm run build` to build or `npm start` to build as you edit files.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
grizzly
2+
polar
3+
brown
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2+
console.log('hello!')
3+
4+
},{}]},{},[1]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('hi!')
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "transform-browserify-bundles",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "budo index.js --live",
8+
"build": "browserify index.js -o bundle.js"
9+
},
10+
"author": "Kyle Robinson Young <[email protected]> (http://dontkry.com)",
11+
"license": "MIT",
12+
"devDependencies": {
13+
"brfs": "^1.4.0",
14+
"browserify": "^10.2.3",
15+
"budo": "^4.0.0",
16+
"through2": "^0.6.5"
17+
},
18+
"browserify": {
19+
"transform": [
20+
"./transform.js"
21+
]
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var through = require('through2')
2+
module.exports = function (file) {
3+
var entireFile = []
4+
return through(function (part, enc, next) {
5+
entireFile.push(part)
6+
next()
7+
}, function (done) {
8+
entireFile = entireFile.join('')
9+
10+
entireFile = entireFile.replace(/hi/g, 'hello')
11+
this.push(entireFile)
12+
done()
13+
})
14+
}

0 commit comments

Comments
 (0)