-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add webpack config for prod * add optimization * rename top package * Add HtmlWebpackPlugin - rough draft * Move templates and ignore generated html * Use loop to create HtmlWebpackPlugins * Remove bundle.js from ensured-targets --------- Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
- Loading branch information
Showing
18 changed files
with
577 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,3 +135,6 @@ ui-tests/playwright-report | |
.pnp.* | ||
ui-tests/.yarn/* | ||
ui-tests/.pnp.* | ||
|
||
# generated html | ||
notebook/templates/*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>{{page_config['appName'] | e}} - Console</title> | ||
{% block favicon %} | ||
<link | ||
rel="icon" | ||
type="image/x-icon" | ||
href="{{ page_config['fullStaticUrl'] | e }}/favicons/favicon-console.ico" | ||
class="favicon" | ||
/> | ||
{% endblock %} {% if custom_css %} | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="{{ base_url | escape }}custom/custom.css" | ||
/> | ||
{% endif %} | ||
</head> | ||
<body class="jp-ThemedContainer"> | ||
{# Copy so we do not modify the page_config with updates. #} {% set | ||
page_config_full = page_config.copy() %} {# Set a dummy variable - we just | ||
want the side effect of the update. #} {% set _ = | ||
page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value | ||
to say that we are on the tree page #} {% set _ = | ||
page_config_full.update(notebookPage='consoles') %} | ||
|
||
<script id="jupyter-config-data" type="application/json"> | ||
{{ page_config_full | tojson }} | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
/* Remove token from URL. */ | ||
(function () { | ||
var parsedUrl = new URL(window.location.href); | ||
if (parsedUrl.searchParams.get('token')) { | ||
parsedUrl.searchParams.delete('token'); | ||
window.history.replaceState({}, '', parsedUrl.href); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>{{page_config['appName'] | e}} - Edit</title> | ||
{% block favicon %} | ||
<link | ||
rel="icon" | ||
type="image/x-icon" | ||
href="{{ base_url | escape }}static/favicons/favicon-file.ico" | ||
class="favicon" | ||
/> | ||
{% endblock %} | ||
</head> | ||
<body class="jp-ThemedContainer" data-notebook="edit"> | ||
{# Copy so we do not modify the page_config with updates. #} {% set | ||
page_config_full = page_config.copy() %} {# Set a dummy variable - we just | ||
want the side effect of the update. #} {% set _ = | ||
page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value | ||
to say that we are on the tree page #} {% set _ = | ||
page_config_full.update(notebookPage='edit') %} | ||
|
||
<script id="jupyter-config-data" type="application/json"> | ||
{{ page_config_full | tojson }} | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
/* Remove token from URL. */ | ||
(function () { | ||
var parsedUrl = new URL(window.location.href); | ||
if (parsedUrl.searchParams.get('token')) { | ||
parsedUrl.searchParams.delete('token'); | ||
window.history.replaceState({}, '', parsedUrl.href); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>{{page_config['appName'] | e}} - Notebook</title> | ||
{% block favicon %} | ||
<link | ||
rel="icon" | ||
type="image/x-icon" | ||
href="{{ base_url | escape }}static/favicons/favicon-notebook.ico" | ||
class="favicon" | ||
/> | ||
{% endblock %} {% if custom_css %} | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="{{ base_url | escape }}custom/custom.css" | ||
/> | ||
{% endif %} | ||
</head> | ||
<body class="jp-ThemedContainer" data-notebook="notebooks"> | ||
{# Copy so we do not modify the page_config with updates. #} {% set | ||
page_config_full = page_config.copy() %} {# Set a dummy variable - we just | ||
want the side effect of the update. #} {% set _ = | ||
page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value | ||
to say that we are on the tree page #} {% set _ = | ||
page_config_full.update(notebookPage='notebooks') %} | ||
|
||
<script id="jupyter-config-data" type="application/json"> | ||
{{ page_config_full | tojson }} | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
/* Remove token from URL. */ | ||
(function () { | ||
var parsedUrl = new URL(window.location.href); | ||
if (parsedUrl.searchParams.get('token')) { | ||
parsedUrl.searchParams.delete('token'); | ||
window.history.replaceState({}, '', parsedUrl.href); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>{{page_config['appName'] | e}} - Terminal</title> | ||
{% block favicon %} | ||
<link | ||
rel="icon" | ||
type="image/x-icon" | ||
href="{{ base_url | escape }}static/favicons/favicon-terminal.ico" | ||
class="favicon" | ||
/> | ||
{% endblock %} {% if custom_css %} | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="{{ base_url | escape }}custom/custom.css" | ||
/> | ||
{% endif %} | ||
</head> | ||
<body class="jp-ThemedContainer"> | ||
{# Copy so we do not modify the page_config with updates. #} {% set | ||
page_config_full = page_config.copy() %} {# Set a dummy variable - we just | ||
want the side effect of the update. #} {% set _ = | ||
page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value | ||
to say that we are on the tree page #} {% set _ = | ||
page_config_full.update(notebookPage='terminals') %} | ||
|
||
<script id="jupyter-config-data" type="application/json"> | ||
{{ page_config_full | tojson }} | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
/* Remove token from URL. */ | ||
(function () { | ||
var parsedUrl = new URL(window.location.href); | ||
if (parsedUrl.searchParams.get('token')) { | ||
parsedUrl.searchParams.delete('token'); | ||
window.history.replaceState({}, '', parsedUrl.href); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Home</title> | ||
{% block favicon %} | ||
<link | ||
rel="icon" | ||
type="image/x-icon" | ||
href="{{ base_url | escape }}static/favicons/favicon.ico" | ||
class="favicon" | ||
/> | ||
{% endblock %} {% if custom_css %} | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="{{ base_url | escape }}custom/custom.css" | ||
/> | ||
{% endif %} | ||
</head> | ||
<body class="jp-ThemedContainer"> | ||
{# Copy so we do not modify the page_config with updates. #} {% set | ||
page_config_full = page_config.copy() %} {# Set a dummy variable - we just | ||
want the side effect of the update. #} {% set _ = | ||
page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} {# Sentinel value | ||
to say that we are on the tree page #} {% set _ = | ||
page_config_full.update(notebookPage='tree') %} | ||
|
||
<script id="jupyter-config-data" type="application/json"> | ||
{{ page_config_full | tojson }} | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
/* Remove token from URL. */ | ||
(function () { | ||
var parsedUrl = new URL(window.location.href); | ||
if (parsedUrl.searchParams.get('token')) { | ||
parsedUrl.searchParams.delete('token'); | ||
window.history.replaceState({}, '', parsedUrl.href); | ||
} | ||
})(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
const merge = require('webpack-merge').default; | ||
const config = require('./webpack.config'); | ||
const WPPlugin = require('@jupyterlab/builder').WPPlugin; | ||
|
||
config[0] = merge(config[0], { | ||
mode: 'production', | ||
devtool: 'source-map', | ||
output: { | ||
// Add version argument when in production so the Jupyter server | ||
// allows caching of files (i.e., does not set the CacheControl header to no-cache to prevent caching static files) | ||
filename: '[name].[contenthash].js?v=[contenthash]', | ||
}, | ||
optimization: { | ||
minimize: false, | ||
}, | ||
plugins: [ | ||
new WPPlugin.JSONLicenseWebpackPlugin({ | ||
excludedPackageTest: (packageName) => | ||
packageName === '@jupyter-notebook/app', | ||
}), | ||
], | ||
}); | ||
|
||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.