繁体   English   中英

如何在grunt中包括javascript库

[英]How to include javascript library in grunt

我正在做一个现有的Ionic项目。 我正在尝试在此项目中包含Ionic的推送通知功能。 当我尝试运行grunt命令时,出现以下错误

Running "jsbeautifier:files" (jsbeautifier) task
Beautified 53 files, changed 0 files...OK

Running "jshint:files" (jshint) task

   ./www/js/app.js
     18 |        var push = new Ionic.Push({
                                ^ 'Ionic' is not defined.

所以看起来lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js下的ionic JS文件没有被载入。 如何解决这个问题? 我是刚开始学习咕and咕和离​​子的,所以请帮帮我。 在其他类似问题中我没有找到任何解决方案。 顺便说一句,该应用程序在浏览器中运行良好。

gruntfile.js jshint

jshint: {
            options: {
                curly: true,
                eqeqeq: true,
                eqnull: true,
                browser: true,
                strict: false,
                globalstrict: false,
                node: true,
                undef: true,
                globals: {
                    angular: true,
                    cordova: true,
                    app: true,
                    StatusBar: true,
                    CameraPopoverOptions: true,
                    ionic: true,
                    Camera: true
                },
            },

            files: {
                src: ["*.js", "./www/js/*.js", "./www/components/**/*.js", "!*.min.js", "!./www/**/*.min.js", "!./www/**/**/*.min.js"]
            }

        },
globals: {
    angular: true,
    cordova: true,
    app: true,
    StatusBar: true,
    CameraPopoverOptions: true,
    Ionic: true,
    Camera: true
}

Ionic应该有资本I

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM