Fix webpack static file configuration

This commit is contained in:
Steven Silvester 2016-03-23 12:55:45 -05:00
parent 468a86e9c1
commit 28829b2524
6 changed files with 10 additions and 8 deletions

View File

@ -3,8 +3,9 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
from tornado import web
from ..base.handlers import IPythonHandler
from ..base.handlers import IPythonHandler, AuthenticatedFileHandler
class LabHandler(IPythonHandler):
@ -18,12 +19,12 @@ class LabHandler(IPythonHandler):
terminals_available=self.settings['terminals_available'],
mathjax_url=self.mathjax_url))
#-----------------------------------------------------------------------------
# URL to handler mappings
#-----------------------------------------------------------------------------
default_handlers = [
(r"/lab", LabHandler),
(r"/lab/build/(.*)", AuthenticatedFileHandler,
{'path': os.path.join(os.path.dirname(__file__), 'build')}),
]

View File

@ -7,8 +7,9 @@ var ContextReplacementPlugin = require("webpack/lib/ContextReplacementPlugin");
module.exports = {
entry: './index.js',
output: {
path: './build',
filename: 'bundle.js'
path: __dirname + "/build",
filename: "bundle.js",
publicPath: "lab/build/"
},
node: {
fs: "empty"

View File

@ -95,7 +95,7 @@
"wsUrl": "{{ws_url| urlencode}}",
"notebookPath": "{{notebook_path | urlencode}}"
}</script>
<script src="{{ static_url("lab/build/bundle.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="lab/build/bundle.js" type="text/javascript" charset="utf-8"></script>
{% endblock %}
</body>

View File

@ -131,7 +131,7 @@ def find_package_data():
])
# Add the Lab page contents
static_data.append(pjoin('static', 'lab', 'build', '*'))
static_data.append(pjoin('lab', 'build', '*'))
components = pjoin("static", "components")
# select the components we actually need to install
@ -341,7 +341,7 @@ class JavascriptDependencies(Command):
bower_dir = pjoin(static, 'components')
node_modules = pjoin(repo_root, 'node_modules')
lab_dir = pjoin(repo_root, 'notebook', 'static', 'lab')
lab_dir = pjoin(repo_root, 'notebook', 'lab')
def run(self):
try: