Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliases still carry .coffee extension #3

Open
bergie opened this issue Apr 29, 2013 · 3 comments
Open

Aliases still carry .coffee extension #3

bergie opened this issue Apr 29, 2013 · 3 comments

Comments

@bergie
Copy link

bergie commented Apr 29, 2013

I'm using your plugin with NoFlo.

When built as standalone, the CoffeeScript files get translated and renamed correctly.

However, when using my package as a dependency, it does work because the require aliases still carry .coffee suffixes:

require.alias("bergie-noflo/src/components/Graph.coffee", "noflo-dataflow/deps/noflo/src/components/Graph.coffee");
require.alias("bergie-noflo/src/components/Output.coffee", "noflo-dataflow/deps/noflo/src/components/Output.coffee");
require.alias("bergie-noflo/src/lib/NoFlo.js", "noflo-dataflow/deps/noflo/index.js");
require.alias("component-emitter/index.js", "bergie-noflo/deps/emitter/index.js");
@bergie
Copy link
Author

bergie commented Apr 29, 2013

Quick workaround is to do a search-replace in the built file before using it. Here is how I'm doing that in my Grunt setup using grunt-combine:

combine:
  browser:
    input: 'dist/dataflo.js'
    output: 'dist/dataflo.js'
    tokens: [
      token: '.coffee'
      string: '.js'
    ]

bergie added a commit to bergie/builder.js that referenced this issue Sep 19, 2013
It is crucial for the loaded configuration files to be persistent so that builder plugins can safely do their `addFile` and `removeFile` calls.

As it is currently, these only affect the one build step where the plugin is called, causing issues with aliasing as reported in anthonyshort/component-coffee#3

There was already a TODO for caching the loaded component manifests, and so this not only makes plugins work better, but should also improve performance.
@bergie
Copy link
Author

bergie commented Nov 14, 2013

This can be closed as soon as componentjs/builder.js#125 is merged and released.

@lmartins
Copy link

Also having this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants