This repository has been archived by the owner on Dec 19, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Browserify CommonJS Babel work
Ian Wehrman edited this page Jun 12, 2015
·
1 revision
Here is all the work I've done to get things running, besides hand de-amd-fying code
- Get rid of JSON.parse calls, Browserify parses them for us
- Get rid of controllerPromise in menu and tool actions, I hacked around this by exposing FluxController in window
- All
require("adapter/ps")
paths need to be in formatrequire("adapter").ps
- In FluxController, we check to see if
actionPromise instanceof Promise
, I changed that toactionPromise.then instanceof Function
- Remove all jsx! prefixes in require() calls
- For React.addons , had to require separately for addons (shared/Button.jsx)
- Map tinycolor to tinycolor2 (add in browser: of packjage.json)
- all
require("EventEmitter")
s need to be replaced byrequire("events").EventEmitter
as wolfy returns an object with ctor inside - Remove all "i18n! prefixes, and require roots/strings.js from nls/strings.js
- Checkout
barkin/browserify
branches on both adapter and design -
npm install
in design folder grunt compile
- Set
node
to true in.jshintrc
- Add dependencies in package.json to wolfy-eventemitter, bluebird and lodash
- Add these lines in package.json (IMPORTANT FOR BROWSERIFY TO WORK)
"browserify": {
"transform": [
"deamdify"
]
},
"browser": {
"eventEmitter": "wolfy-eventemitter"
}
- add index.js files to each folder requiring all files
- Suffix all
require("eventEmitter")
s by.EventEmitter