mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Merge pull request #1953 from jasongrout/polyfill
Polyfill promises from the page template.
This commit is contained in:
commit
2fd22fa254
@ -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'
|
||||
|
@ -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",
|
||||
|
@ -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'),
|
||||
|
Loading…
Reference in New Issue
Block a user