Mercurial > piecrust2
comparison piecrust/processing/browserify.py @ 1041:717ac3c4ee77
bake: Fix where the Browserify processor outputs things.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 20 Jan 2018 17:15:24 -0800 |
parents | 7487e2df8a56 |
children | c2bfa1869f0d |
comparison
equal
deleted
inserted
replaced
1040:506a5cb1e942 | 1041:717ac3c4ee77 |
---|---|
13 PROCESSOR_NAME = 'browserify' | 13 PROCESSOR_NAME = 'browserify' |
14 | 14 |
15 def __init__(self): | 15 def __init__(self): |
16 super(BrowserifyProcessor, self).__init__() | 16 super(BrowserifyProcessor, self).__init__() |
17 self.priority = PRIORITY_FIRST | 17 self.priority = PRIORITY_FIRST |
18 self.is_bypassing_structured_processing = True | 18 self.is_delegating_dependency_check = False |
19 self._conf = None | 19 self._conf = None |
20 | 20 |
21 def initialize(self, app): | 21 def initialize(self, app): |
22 super(BrowserifyProcessor, self).initialize(app) | 22 super(BrowserifyProcessor, self).initialize(app) |
23 | 23 |
34 return self._conf is not None and os.path.splitext(path)[1] == '.js' | 34 return self._conf is not None and os.path.splitext(path)[1] == '.js' |
35 | 35 |
36 def getDependencies(self, path): | 36 def getDependencies(self, path): |
37 return FORCE_BUILD | 37 return FORCE_BUILD |
38 | 38 |
39 def getOutputFilenames(self, filename): | |
40 return [filename] | |
41 | |
39 def process(self, path, out_dir): | 42 def process(self, path, out_dir): |
40 _, fname = os.path.split(path) | 43 out_path = os.path.join(out_dir, os.path.basename(path)) |
41 out_path = os.path.join(out_dir, fname) | |
42 | 44 |
43 args = [self._conf['bin'], path, '-o', out_path] | 45 args = [self._conf['bin'], path, '-o', out_path] |
44 cwd = self.app.root_dir | 46 cwd = self.app.root_dir |
45 logger.debug("Running Browserify: %s" % ' '.join(args)) | 47 logger.debug("Running Browserify: %s" % ' '.join(args)) |
46 try: | 48 try: |