Sfoglia il codice sorgente

Make jquery and webpack external

Steven Silvester 8 anni fa
parent
commit
4a2c6a6a66
2 ha cambiato i file con 14 aggiunte e 0 eliminazioni
  1. 4 0
      jupyterlab/lab.html
  2. 10 0
      jupyterlab/webpack.conf.js

+ 4 - 0
jupyterlab/lab.html

@@ -13,6 +13,10 @@ Distributed under the terms of the Modified BSD License.
     {% if mathjax_url %}
     <script type="text/javascript" src="{{mathjax_url}}?config={{mathjax_config}}&amp;delayStartupUntil=configured" charset="utf-8"></script>
     {% endif %}
+    <script src="{{static_url("components/codemirror/lib/codemirror.js") }}" type="text/javascript" charset="utf-8"></script>
+    <script src="{{static_url("components/codemirror/mode/meta.js") }}" type="text/javascript" charset="utf-8"></script>
+    <script src="{{static_url("components/jquery/jquery.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- window.$ -->
+    <script src="{{static_url("components/jquery-ui/ui/minified/jquery-ui.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
 </head>
 
 

+ 10 - 0
jupyterlab/webpack.conf.js

@@ -32,5 +32,15 @@ module.exports = {
       { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
       { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=image/svg+xml" }
     ]
+  },
+  externals: {
+    jquery: '$',
+    'jquery-ui': '$',
+    'codemirror': 'CodeMirror',
+    'codemirror/lib/codemirror': 'CodeMirror',
+    'codemirror/mode/meta': 'CodeMirror',
+    // Account for relative paths from other CodeMirror files
+    '../../lib/codemirror': 'CodeMirror',
+    '../lib/codemirror': 'CodeMirror' 
   }
 }