Example #1
0
 def build_contents(self):
     source_css = self.concatinate_files()
     if settings.STATIC_MEDIA_COMPRESSED:
         return utils.run_command([
             'sass', '-t', 'compressed', '-E', 'utf-8',
             '--load-path', os.path.join(static_root(), 'css'),
             '--scss', '--stdin',
         ], stdin=source_css)
     else:
         return utils.run_command([
             'sass', '-t', 'expanded', '-E', 'utf-8',
             '--load-path', os.path.join(static_root(), 'css'),
             '--scss', '--stdin',
         ], stdin=source_css)
Example #2
0
 def build_contents(self):
     source_css = self.concatinate_files()
     if settings.STATIC_MEDIA_COMPRESSED:
         sass_type = 'compressed'
     else:
         sass_type = 'expanded'
     cmdline = [
         'sass',
         '-t',
         sass_type,
         '-E',
         'utf-8',
     ]
     for path in self.include_paths():
         cmdline.extend(['--load-path', path])
     cmdline.extend(['--scss', '--stdin'])
     return utils.run_command(cmdline, stdin=source_css)
Example #3
0
 def _build_contents(self, build_dir):
     self.setup_build_dir(build_dir)
     optimize = "uglify" if settings.STATIC_MEDIA_COMPRESSED else "none"
     build_config = {
         'baseUrl': build_dir,
         'mainConfigFile': os.path.join(build_dir,
                                        self.config_module() + '.js'),
         'findNestedDependencies': True,
         'name': os.path.join(settings.STATIC_ROOT,
                              "bower/almond/almond.js"),
         'include': [self.main_module()] + self.extension_modules(),
         'insertRequire': self.extension_modules(),
         'optimize': optimize,
         'logLevel': 4,
     }
     r_path = os.path.join(settings.STATIC_ROOT, 'bower/rjs/dist/r.js')
     with tempfile.NamedTemporaryFile(suffix='.js', prefix='build-') as f:
         json.dump(build_config, f)
         f.flush()
         return utils.run_command(
             ['nodejs', r_path, '-o', f.name, 'out=stdout'])
Example #4
0
 def build_contents(self):
     source_code = self.concatinate_files()
     if settings.STATIC_MEDIA_COMPRESSED:
         return utils.run_command(['uglifyjs'], stdin=source_code)
     else:
         return source_code