Todd Price
Todd Price

Reputation: 2760

Adding a module dependency in Aurelia with Webpack

I'm just getting started with the Aurelia Webpack Skeleton and trying to simply add a new dependency. Suppose I want to use moment.js in my application. What are the expected steps to download and use the module in my application?

EDIT: I see that moment.js is already loaded by default. So suppose it's numeral.js I want to use as an example.

Upvotes: 2

Views: 1252

Answers (1)

Fabio
Fabio

Reputation: 11990

Install the library via npm using a console, pointing to the application folder:

npm install numeral --save

Now, you just have to import it in your js file:

import numeral from 'numeral';

Upvotes: 3

Related Questions