Skip to content

Commit

Permalink
[requirejs] use requirejs over require, no simplified commonjs wrapper
Browse files Browse the repository at this point in the history
* use requirejs over require variable name to avoid confusion on node.
  See jupyter/notebook#155 for details.

* don't use the requirejs simplified commonjs wrapper
  ipython-contrib/jupyter_contrib_nbextensions#1165
  which is slower than a dependency array, and relies on toString parsing.
  See ipython-contrib/jupyter_contrib_nbextensions#1165
  for details.
  • Loading branch information
jcb91 committed Dec 4, 2017
1 parent 244cc71 commit 7effd29
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
define(function (require, exports, module) {
define([
'jquery',
'base/js/namespace',
'base/js/events',
'base/js/utils',
'notebook/js/codecell',
], function (
requirejs,
$,
Jupyter,
events,
utils,
codecell
) {
"use strict";
var $ = require('jquery');
var Jupyter = require('base/js/namespace');
var events = require('base/js/events');
var utils = require('base/js/utils');
var CodeCell = require('notebook/js/codecell').CodeCell;

var CodeCell = codecell.CodeCell;

var Scratchpad = function (nb) {
var scratchpad = this;
Expand Down Expand Up @@ -124,7 +132,7 @@ define(function (require, exports, module) {
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = require.toUrl("./scratchpad.css");
link.href = requirejs.toUrl("./scratchpad.css");
document.getElementsByTagName("head")[0].appendChild(link);
// load when the kernel's ready
if (Jupyter.notebook.kernel) {
Expand Down

0 comments on commit 7effd29

Please sign in to comment.