【问题标题】:agGrid not working with Webpack and Coffee scriptagGrid 无法使用 Webpack 和 Coffee 脚本
【发布时间】:2016-11-14 23:20:25
【问题描述】:

所以在 Webpack 中我有以下...

var files = glob.sync([
    './src/main/coffee/**/*Module.coffee',
    './src/main/coffee/**/*.coffee'
]);
module.exports = {
    context: __dirname,
    entry: {
        polyfills: './src/main/typescripts/polyfills.ts',
        vendor: './src/main/typescripts/vendor.ts',
        app: files
    },
    ....
}

在我的供应商 Typescript 文件中,我有 import "ag-grid"。最后我在咖啡文件中有agGrid.initialiseAgGridWithAngular1 angular

当我尝试运行我的应用程序时,我得到...

未捕获的 ReferenceError:未定义 agGrid

我在这里错过了什么?

【问题讨论】:

    标签: coffeescript webpack ag-grid


    【解决方案1】:

    您的模块中是否需要 agGrid?

    app = angular.module 'myApp', ['agGrid']

    【讨论】:

    • 是的,当然,当我只包含依赖项时它也可以工作,而不是在被 Webpack 包装时。请在做之前检查你的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 2018-06-21
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多