javascript - BigNumber usage with Webpack + Angular -
error: [$injector:unpr] unknown provider: bignumberprovider
i'm starting project webpack + angular.js
, want use bignumber.js
can't include it.
the part of webpack config:
resolve: { root: [path.join(__dirname, 'assets/libs/bower_components'), 'node_modules'] }, entry: { entry: ['./app/app.js'], vendor: [ 'lodash', 'bignumber.js', 'angular' ....
as it's library not include dependency in main app.js. i'm trying inject directive:
app.directive('createpayment', [ '$http', ' * ', // i've tried bignumber, bignumber, binumber.js of doen't work // , there nothing in readme function($http, bignumber ? , bignumber ? ) {
this can achieved utilizing provideplugin
plugin webpack:
webpack.config.js
... plugins: [ new webpack.provideplugin({ bignumber: 'bignumber.js', lodash: 'lodash', $: 'jquery' }), ] ...
the provideplugin
definition assumes have added resolve
declaration webpack configuration.
Comments
Post a Comment