build: generate sourcemap for CSS files (#49794)
This commit is contained in:
parent
a58551e616
commit
8d33aa0e82
|
@ -7,6 +7,6 @@ recursive-include data/web/ *.html *.css *.png
|
||||||
recursive-include data/themes/default/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml
|
recursive-include data/themes/default/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml
|
||||||
recursive-include data/themes/alto/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml
|
recursive-include data/themes/alto/ *.html *.css *.png *.gif *.jpg *.js *.ezt *.xml
|
||||||
recursive-include data/vendor/ *.dat
|
recursive-include data/vendor/ *.dat
|
||||||
recursive-include wcs/qommon/static/ *.css *.scss *.png *.gif *.jpg *.js *.eot *.svg *.ttf *.woff
|
recursive-include wcs/qommon/static/ *.css *.scss *.png *.gif *.jpg *.js *.eot *.svg *.ttf *.woff *.map
|
||||||
recursive-include wcs/templates *.html *.txt
|
recursive-include wcs/templates *.html *.txt
|
||||||
recursive-include wcs/qommon/templates *.html *.txt
|
recursive-include wcs/qommon/templates *.html *.txt
|
||||||
|
|
16
setup.py
16
setup.py
|
@ -53,13 +53,9 @@ class compile_scss(Command):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
sass_bin = None
|
sass_bin = find_executable('sassc')
|
||||||
for program in ('sassc', 'sass'):
|
|
||||||
sass_bin = find_executable(program)
|
|
||||||
if sass_bin:
|
|
||||||
break
|
|
||||||
if not sass_bin:
|
if not sass_bin:
|
||||||
raise CompileError('A sass compiler is required but none was found. See sass-lang.com for choices.')
|
raise CompileError('sassc is required but was not found.')
|
||||||
|
|
||||||
for path, dirnames, filenames in os.walk('wcs'):
|
for path, dirnames, filenames in os.walk('wcs'):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
|
@ -67,7 +63,10 @@ class compile_scss(Command):
|
||||||
continue
|
continue
|
||||||
if filename.startswith('_'):
|
if filename.startswith('_'):
|
||||||
continue
|
continue
|
||||||
subprocess.check_call([sass_bin, '%s/%s' % (path, filename),
|
subprocess.check_call([
|
||||||
|
sass_bin,
|
||||||
|
'--sourcemap',
|
||||||
|
'%s/%s' % (path, filename),
|
||||||
'%s/%s' % (path, filename.replace('.scss', '.css'))])
|
'%s/%s' % (path, filename.replace('.scss', '.css'))])
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,7 +96,8 @@ class eo_sdist(sdist):
|
||||||
|
|
||||||
def data_tree(destdir, sourcedir):
|
def data_tree(destdir, sourcedir):
|
||||||
extensions = ['.css', '.png', '.jpeg', '.jpg', '.gif', '.xml', '.html',
|
extensions = ['.css', '.png', '.jpeg', '.jpg', '.gif', '.xml', '.html',
|
||||||
'.js', '.ezt', '.dat', '.eot', '.svg', '.ttf', '.woff']
|
'.js', '.ezt', '.dat', '.eot', '.svg', '.ttf', '.woff', '.scss',
|
||||||
|
'.map']
|
||||||
r = []
|
r = []
|
||||||
for root, dirs, files in os.walk(sourcedir):
|
for root, dirs, files in os.walk(sourcedir):
|
||||||
l = [os.path.join(root, x) for x in files if os.path.splitext(x)[1] in extensions]
|
l = [os.path.join(root, x) for x in files if os.path.splitext(x)[1] in extensions]
|
||||||
|
|
Loading…
Reference in New Issue