Merge pull request #1953 from jasongrout/polyfill

Polyfill promises from the page template.
This commit is contained in:
Paul Ivanov 2016-12-07 12:01:56 -08:00 committed by GitHub
commit 2fd22fa254
3 changed files with 13 additions and 15 deletions

View File

@ -23,8 +23,10 @@ env:
before_install:
- pip install --upgrade pip
- pip install --upgrade setuptools wheel nose coverage codecov
- nvm install 5.6
- nvm use 5.6
- nvm install 6.9.2
- nvm use 6.9.2
- node --version
- npm --version
- npm upgrade -g npm
- npm install
- 'if [[ $GROUP == js* ]]; then npm install -g casperjs@1.1.0-beta5; fi'

View File

@ -37,7 +37,7 @@
"webpack": "^1.12.13"
},
"dependencies": {
"es6-promise": "^3.3.1",
"es6-promise": "^4.0.5",
"moment": "^2.8.4",
"preact": "^4.5.1",
"preact-compat": "^1.7.0",

View File

@ -1,13 +1,14 @@
// Support for Node 0.10
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
// See https://github.com/webpack/css-loader/issues/144
require('es6-promise').polyfill();
var webpack = require('webpack');
var _ = require('underscore');
var path = require('path');
var sourcemaps = 'inline-source-map';
if(process.argv.indexOf('-w') !== -1 || process.argv.indexOf('-w') !== -1 ){
console.log('watch mode detected, will switch to cheep sourcemaps');
console.log('watch mode detected, will switch to cheap sourcemaps');
sourcemaps = 'eval-source-map';
}
@ -49,19 +50,14 @@ var commonConfig = {
'codemirror/mode/meta': 'CodeMirror',
// Account for relative paths from other CodeMirror files
'../../lib/codemirror': 'CodeMirror',
'../lib/codemirror': 'CodeMirror'
'../lib/codemirror': 'CodeMirror'
},
plugins: [
new webpack.ProvidePlugin({
'Promise': 'es6-promise',
})
]
};
function buildConfig(appName) {
if (typeof appName !== 'string') return appName;
return _.extend({}, commonConfig, {
entry: './notebook/static/' + appName + '/js/main.js',
entry: ['es6-promise/auto','./notebook/static/' + appName + '/js/main.js'],
output: {
filename: 'main.min.js',
path: path.join(__dirname, 'notebook', 'static', appName, 'js', 'built')
@ -77,7 +73,7 @@ module.exports = [
'tree',
'notebook',
_.extend({}, commonConfig, {
entry: './notebook/static/services/contents.js',
entry: ['es6-promise/auto', './notebook/static/services/contents.js'],
output: {
filename: 'contents.js',
path: path.join(__dirname, 'notebook', 'static', 'services', 'built'),
@ -86,7 +82,7 @@ module.exports = [
devtool: sourcemaps,
}),
_.extend({}, commonConfig, {
entry: './notebook/static/index.js',
entry: ['es6-promise/auto', './notebook/static/index.js'],
output: {
filename: 'index.js',
path: path.join(__dirname, 'notebook', 'static', 'built'),