mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-12 14:00:27 +08:00
add npm run build:css
setup.py css is just an alias for this, so there should be no more calls back to Python from npm run build:anything
This commit is contained in:
parent
0849f68f66
commit
4c7f5972e1
@ -13,7 +13,9 @@
|
||||
"bower": "bower install --allow-root --config.interactive=false",
|
||||
"build:watch": "concurrent \"npm run build:css:watch\" \"npm run build:js:watch\"",
|
||||
"build": "npm run build:css && npm run build:js",
|
||||
"build:css": "python setup.py css",
|
||||
"build:css": "concurrent 'npm run build:css:ipython' 'npm run build:css:style'",
|
||||
"build:css:ipython": "lessc --source-map --include-path=notebook/static notebook/static/style/ipython.less notebook/static/style/ipython.min.css",
|
||||
"build:css:style": "lessc --source-map --include-path=notebook/static notebook/static/style/style.less notebook/static/style/style.min.css",
|
||||
"build:css:watch": "echo Not implemented yet...",
|
||||
"build:js": "webpack",
|
||||
"build:js:watch": "npm run build:js -- --watch"
|
||||
|
24
setupbase.py
24
setupbase.py
@ -403,29 +403,17 @@ class CompileCSS(Command):
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
sources = []
|
||||
targets = []
|
||||
for name in ('ipython', 'style'):
|
||||
sources.append(pjoin(static, 'style', '%s.less' % name))
|
||||
targets.append(pjoin(static, 'style', '%s.min.css' % name))
|
||||
|
||||
def run(self):
|
||||
self.run_command('jsdeps')
|
||||
env = os.environ.copy()
|
||||
env['PATH'] = npm_path
|
||||
|
||||
for src, dst in zip(self.sources, self.targets):
|
||||
try:
|
||||
run(['lessc',
|
||||
'--source-map',
|
||||
'--include-path=%s' % pipes.quote(static),
|
||||
src,
|
||||
dst,
|
||||
], cwd=repo_root, env=env)
|
||||
except OSError as e:
|
||||
print("Failed to build css: %s" % e, file=sys.stderr)
|
||||
print("You can install js dependencies with `npm install`", file=sys.stderr)
|
||||
raise
|
||||
try:
|
||||
run(['npm', 'run', 'build:css'])
|
||||
except OSError as e:
|
||||
print("Failed to run npm run build:css : %s" % e, file=sys.stderr)
|
||||
print("You can install js dependencies with `npm install`", file=sys.stderr)
|
||||
raise
|
||||
# update package data in case this created new files
|
||||
update_package_data(self.distribution)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user