jsx: build directly in destination

removes `npm run place`, allows build:watch
This commit is contained in:
Min RK
2024-03-06 00:27:18 +01:00
parent fd78a03280
commit 87bf84d05f
4 changed files with 4 additions and 9 deletions

2
.gitignore vendored
View File

@@ -38,3 +38,5 @@ docs/source/reference/metrics.rst
oldest-requirements.txt oldest-requirements.txt
jupyterhub-proxy.pid jupyterhub-proxy.pid
examples/server-api/service-token examples/server-api/service-token
*.hot-update*

View File

@@ -7,8 +7,8 @@
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"scripts": { "scripts": {
"build": "webpack", "build": "webpack",
"build:watch": "webpack watch",
"hot": "webpack && webpack-dev-server", "hot": "webpack && webpack-dev-server",
"place": "cp build/admin-react.js* ../share/jupyterhub/static/js/",
"test": "jest --verbose", "test": "jest --verbose",
"snap": "jest --updateSnapshot", "snap": "jest --updateSnapshot",
"lint": "eslint --ext .jsx --ext .js src/", "lint": "eslint --ext .jsx --ext .js src/",

View File

@@ -28,7 +28,7 @@ module.exports = {
output: { output: {
publicPath: "/", publicPath: "/",
filename: "admin-react.js", filename: "admin-react.js",
path: path.resolve(__dirname, "build"), path: path.resolve(__dirname, "../share/jupyterhub/static/js/"),
}, },
resolve: { resolve: {
extensions: [".css", ".js", ".jsx"], extensions: [".css", ".js", ".jsx"],

View File

@@ -215,13 +215,6 @@ class JSX(BaseCommand):
shell=shell, shell=shell,
) )
print("Copying JSX admin app to static/js")
check_call(
["npm", "run", "place"],
cwd=self.jsx_dir,
shell=shell,
)
# update data-files in case this created new files # update data-files in case this created new files
self.distribution.data_files = get_data_files() self.distribution.data_files = get_data_files()
assert not self.should_run(), 'JSX.run failed' assert not self.should_run(), 'JSX.run failed'