问题
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.
回答1:
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';
来源:https://stackoverflow.com/questions/36579305/adding-a-module-dependency-in-aurelia-with-webpack