componentjs / builder2.js

builder for component
50 stars 20 forks source link

renaming `require` breaks things #47

Closed azhang closed 10 years ago

azhang commented 10 years ago
var r = require
type = r('type')

Not sure if this is intended behavior, but in this case, r('type') is directly copied over to the output.

However,

type = require('type');

will produce the expected output:

type = require("component~type@1.0.0");

For reference this is from "forbeslindesay~ajax@0.0.2" but since this isn't expected I thought I'd raise the issue here too.

jonathanong commented 10 years ago

yeah more of a docs issue. there's no reason you need to do this though. alternative is to actually parse the JS, but that's when shit gets too complicated.

in the future. you won't be able to rewrite import.

azhang commented 10 years ago

Gotcha, cool.