j0hnsmith / django-pipeline-browserify

MIT License
37 stars 18 forks source link

Inconsistent: compile_file reads from pipeline_settings while is_outdated reads PIPELINE_* settings #15

Closed MrCsabaToth closed 7 years ago

MrCsabaToth commented 8 years ago

See https://github.com/j0hnsmith/django-pipeline-browserify/blob/master/pipeline_browserify/compiler.py#L19 vs. https://github.com/j0hnsmith/django-pipeline-browserify/blob/master/pipeline_browserify/compiler.py#L55

To overcome that, I need to set things twice:

PIPELINE['BROWSERIFY_BINARY'] = 'c:\\Users\\JohnSmith\\node_modules\\.bin\\browserify.cmd'
PIPELINE_BROWSERIFY_BINARY = PIPELINE['BROWSERIFY_BINARY']
if DEBUG:
    PIPELINE["BROWSERIFY_ARGUMENTS"] = '-t babelify'
    PIPELINE_BROWSERIFY_ARGUMENTS = PIPELINE["BROWSERIFY_ARGUMENTS"]

Should I make a pull request? I like pipeline_settings better.

natevw commented 8 years ago

Yeah, I think this might be the cause of a regression I'm seeing after upgrading from 0.4.0 to 0.4.1 — now my assets compile fine the first time, but the next edit results in a [Errno 2] No such file or directory message.

I have browserify installed locally, not globally, and so I was using PIPELINE['BROWSERIFY_BINARY'] to override it as documented. I'd agree that the is_outdated is looking for the wrong setting — certainly a backwards-incompatible expectation anyway.

Thanks @MrCsabaToth for figuring this one out and providing the workaround!

natevw commented 7 years ago

@j0hnsmith Can you weigh in here? It'd be great if PIPELINE['BROWSERIFY_BINARY'] were used in both places. Would you like a pull request or is it just as simple to fix it in a new release yourself?

j0hnsmith commented 7 years ago

@natevw a PR would be great