zambezi / ez-build

Zambezi build tool
MIT License
2 stars 1 forks source link

Only use the last fragment of the package name #28

Closed Poetro closed 8 years ago

Poetro commented 8 years ago

Description

Only use the last fragment of the package name

Motivation and Context

Solves #26

How Was This Tested?

See #4; also

mkdir temp && cd temp && npm init -y --scope=@zambezi && \
mkdir src && touch src/index.js && ez-build --production && \
ls temp-min.js
temp-min.js

Types of changes

mstade commented 8 years ago

This is a way to solve the output issue for sure, but really the scope is part of the package name and so this is fixing it in the wrong place. I think we should probably just fix this where the files are actually written, here and here. Indeed, as you pointed out in chat, the -o,--out <prefix> option is broken so those two lines should be changed to use opts.out instead of pkg.name altogether, fixing two bugs in one PR. We should obviously fix the default of that option by popping off just the package name. That oughta do it.

mstade commented 8 years ago

Solid PR, thanks!

mstade commented 8 years ago

This works great – thanks! I'll release 0.4.1, and add tests in a later PR.