簡體   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