Skip to content

Commit

Permalink
Use babel-plugin-transform-runtime instead of babel-polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Feb 13, 2016
1 parent 3640768 commit 2ebc9ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": ["es2015", "stage-0", "react"],
"plugins": ["add-module-exports", "transform-decorators-legacy"],
"plugins": ["add-module-exports", "transform-decorators-legacy", "transform-runtime"],
"env": {
"test": {
"plugins": [
Expand Down
6 changes: 3 additions & 3 deletions chrome/extension/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'babel-polyfill';
global.Promise = require('bluebird');
const bluebird = require('bluebird');
global.Promise = bluebird;

function promisifier(method) {
// return a function
Expand All @@ -15,7 +15,7 @@ function promisifier(method) {
}

function promisifyAll(obj, list) {
list.forEach(api => Promise.promisifyAll(obj[api], { promisifier }));
list.forEach(api => bluebird.promisifyAll(obj[api], { promisifier }));
}

// let chrome extension api support Promise
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"compress-keygen": "crx keygen",
"clean": "rimraf build/ dev/ *.zip *.crx",
"lint": "eslint app chrome test scripts",
"test-e2e": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register --require babel-polyfill --recursive --require co-mocha test/e2e",
"test-e2e": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register --recursive --require co-mocha test/e2e",
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register --recursive --require ./test/setup-app test/app"
},
"repository": {
Expand All @@ -33,8 +33,8 @@
"babel-loader": "^6.2.0",
"babel-plugin-add-module-exports": "^0.1.1",
"babel-plugin-transform-decorators-legacy": "^1.2.0",
"babel-plugin-transform-runtime": "^6.5.2",
"babel-plugin-webpack-loaders": "^0.3.0",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.0.0",
Expand Down
1 change: 0 additions & 1 deletion test/setup-app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'babel-polyfill';
import { jsdom } from 'jsdom';

global.document = jsdom('<!doctype html><html><body></body></html>');
Expand Down

0 comments on commit 2ebc9ad

Please sign in to comment.