5

First I included the stripe.js file via bower:

bower install --save stripe.js=https://js.stripe.com/v2/

Which created "vendor/stripe/index" (note not index.js, but index). Then I added this to my broccoli file:

app.import('vendor/stripe/index')

Which gets me this error:

You must pass a file to `app.import`. For directories specify them to the constructor under the `trees` option.Error: You must pass a file to `app.import`. For directories specify them to the constructor under the `trees` option.
  at EmberApp.import (/home/jim/Desktop/TaskVelocity/task-velocity/node_modules/ember-cli/lib/broccoli/ember-app.js:521:11)
  at Object.<anonymous> (/home/jim/Desktop/TaskVelocity/task-velocity/Brocfile.js:9:11)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)

What am I missing to get this to work?

Tried the suggestion from the user, and received this error:

Path or pattern "vendor/stripe/stripe.js" did not match any files Error: Path or pattern "vendor/stripe/stripe.js" did not match any files 
at Object.multiGlob   (/home/jim/Desktop/TaskVelocity/web/node_modules/ember-cli/node_modules/broccoli‌​-concat/node_modules/broccoli-kitchen-sink-helpers/index.js:221:13) – 
Jim Barrows
  • 3,634
  • 1
  • 25
  • 36

3 Answers3

4

Personally, I manually created everything, because the /v2/index.js really messed things up. Not ideal, I know, but Stripe works quite nicely in my app now.

In my Brocfile.js:

   app.import('vendor/stripe/stripe.js');

And in my app's file structure, this file is at:

   [appname]/vendor/stripe/stripe.js

There is, if I recall, a stripe npm package, too. I don't know how up to date it is.

afithings
  • 691
  • 1
  • 9
  • 16
1

This is not officially endorsed AFAICT and may therefore break at any moment, but you can install the script like this instead:

bower install --save stripe.js=https://js.stripe.com/v2/stripe.js

This will create an index.js file that you should then be able to use normally.

Piotr
  • 432
  • 5
  • 9
0

You can try to rename the file with broccoli-file-mover. See http://iamstef.net/ember-cli/#customizing-a-built-in-asset

flecno
  • 76
  • 2
  • Path or pattern "vendor/stripe/stripe.js" did not match any files Error: Path or pattern "vendor/stripe/stripe.js" did not match any files at Object.multiGlob (/home/jim/Desktop/TaskVelocity/web/node_modules/ember-cli/node_modules/broccoli-concat/node_modules/broccoli-kitchen-sink-helpers/index.js:221:13) – Jim Barrows Jul 11 '14 at 14:33