导入 UIkit Angular FullStack

Import UIkit Angular FullStack

我在尝试使用 Angular FullStack 生成器导入 UIkit 时遇到此错误:

Module 'uikit' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

这是我所做的:

webpack.make.js

    if(TEST) {
        config.entry = {};
    } else {
        config.entry = {
            app: './client/app/app.js',
            polyfills: './client/polyfills.js',
            vendor: [
                'angular',
                'angular-animate',
                'angular-aria',
                'angular-cookies',
                'angular-resource',

                'angular-sanitize',


                'angular-ui-router',
                'lodash',

                'uikit'
            ]
        };
    }

app.js

...
import uikit from 'uikit';
...

angular.module('myApp', [ngCookies, ngResource, ngSanitize, uiRouter, uikit])

但是,我可以通过将以下内容添加到我的 app.scss 来使用样式指令:

@import'~uikit/dist/css/uikit.css';

但是,如果我不导入 JS 模块,我会得到 UIkit is not defined

如何正确地将 UIkit 导入到我的项目中?

提前致谢:)

docs 之后,这对我有用:

  1. 不要将 uikit 供应商添加到 webpack.make.js
  2. import UIkit from 'uikit'; 插入我的 app.js