Giter Site home page Giter Site logo

Comments (5)

ryanflorence avatar ryanflorence commented on August 29, 2024

You can drop it in vendor, and then require it in app.js require('./vendor/moment') or whatever.

Might want to add exports in there to make it more commonjs happy.

from ember-tools.

bennidhamma avatar bennidhamma commented on August 29, 2024

Perfect. Makes sense. Thanks!
On May 6, 2013 9:12 AM, "Ryan Florence" [email protected] wrote:

You can drop it in vendor, and then require it in app.js
require('./vendor/moment') or whatever.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-17491225
.

from ember-tools.

sarus avatar sarus commented on August 29, 2024

Sorry to repost on this old issue but I just started with ember a couple weeks ago and I'm not trying out ember-tools. I have my app moved over to the ember-tools directory layout but I'm now stuck trying to get moment.js working. As you mentioned in this issue I dropped moment.js (the latest minified version from the website) into the vendor directory. I then added the line:

require('../vendor/moment');

to app.js. Building the app works fine but when I open up the website I get the following error:

Uncaught ReferenceError: moment is not defined

Do I need to make any modifications to moment.js itself? You mentioned adding exports to make commonjs more happy. Can you elaborate on that a bit? Thank you for your help!

from ember-tools.

nlandolfi avatar nlandolfi commented on August 29, 2024

try

moment = require('../vendor/moment');

from ember-tools.

sarus avatar sarus commented on August 29, 2024

Awesome, thank you. That's all it was.

from ember-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.