Skip to content

Commit

Permalink
Adding babel-runtime and transform plugins to remove the need of glob…
Browse files Browse the repository at this point in the history
…al polyfill (#6)
  • Loading branch information
kafkahw authored Oct 13, 2017
1 parent ba3e43d commit 86ab93d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
"presets": [ "es2015" ]
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "iOS >=10", "ie >= 10"]
}
}]
],
"plugins": [
"array-includes",
"transform-object-assign",
"transform-runtime",
]
}
2 changes: 1 addition & 1 deletion example/cross_origin_communication/3_a_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2>authorized app</h2>
<button class="button" id="btn-unmount">unmount</button>
</p>
<script>
XFC.Consumer.init()
XFC.Consumer.init();
var frame = XFC.Consumer.mount(document.body, 'http://localprovider.com:8080/example/cross_origin_communication/3_a_provider.html');
var btn = document.getElementById('btn-unmount');
btn.addEventListener('click', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}
html[hidden] { display: none; }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js"></script>
</head>
<body>
<div>
Expand Down Expand Up @@ -48,4 +49,4 @@ <h1>2. Embedded App Lifecycle</h1>
initializeProviderOAuth();
</script>
</body>
</html>
</html>
1 change: 1 addition & 0 deletions example/initialization/1_b_secret_function.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
html[hidden] { display: none; }
</style>
<script src="http://localhost:8080/xfc.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js"></script>
</head>
<body>
<div>
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
"test": "mocha --compilers js:babel-core/register --recursive"
},
"dependencies": {
"jsonrpc-dispatch": "^2.0.0",
"babel-runtime": "^6.26.0",
"jsonrpc-dispatch": "^2.3.0",
"mutation-observer": "^1.0.3"
},
"devDependencies": {
"babel-cli": "^6.7.5",
"babel-core": "^6.7.7",
"babel-loader": "^6.2.4",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.6.0",
"babel-plugin-array-includes": "^2.0.3",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"chai": "^3.5.0",
"eslint": "^2.13.1",
"eslint-config-airbnb": "^9.0.1",
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const pkg = require('./package.json');

module.exports = {
entry: {
xfc: ['babel-polyfill', './src'],
xfc: ['./src'],
},
output: {
filename: 'xfc.js',
Expand All @@ -28,5 +28,5 @@ module.exports = {
host: '0.0.0.0',
disableHostCheck: true,
},
devtool: 'cheap-eval-source-map',
devtool: 'source-map',
};

0 comments on commit 86ab93d

Please sign in to comment.