1

使用StackOverflow 问题Grid 模块中指定的 Telerik Grid 模块和汇总设置无法获取“orderBy”。GridModule、SharedModule、IntlService 等其他模块正在得到解决。

这是我命名的导出:

 import rollup      from 'rollup'
import nodeResolve from 'rollup-plugin-node-resolve'
import commonjs    from 'rollup-plugin-commonjs';
import uglify      from 'rollup-plugin-uglify'

//paths are relative to the execution path
export default {
entry: 'app/main-aot.js',
    dest: 'aot/dist/build.js', // output a single application bundle
sourceMap: true,
sourceMapFile: 'aot/dist/build.js.map',
format: 'iife',
plugins: [
  nodeResolve({jsnext: true, module: true}),
  commonjs({
     // include: ['node_modules/rxjs/**'],
      namedExports: {
            '@progress/kendo-angular-grid': ['GridModule'],
            '@progress/kendo-angular-intl/dist/npm/js/intl.service': ['IntlService'],
            '@progress/kendo-angular-intl/dist/npm/js/cldr-intl.service': ['CldrIntlService'],
            '@progress/kendo-data-query/dist/npm/js/array.operators': ['orderBy'],
            '@progress/kendo-data-query/dist/npm/js/sort-descriptor': ['SortDescriptor'],
            '@progress/kendo-data-query/dist/npm/js/data-result.interface': ['DataResult'],
            '@progress/kendo-data-query/dist/npm/js/common.interfaces': ['Predicate'],
            '@progress/kendo-data-query/dist/npm/js/state': ['State'],
            '@progress/kendo-angular-grid/dist/npm/js/grid.module': ['GridModule'],
            '@progress/kendo-angular-grid/dist/npm/js/shared.module': ['SharedModule'],
            '@progress/kendo-angular-grid/dist/npm/js/grid.component': ['GridComponent', 'DEFAULT_SCROLLER_FACTORY'],
            '@progress/kendo-angular-grid/dist/npm/js/browser-support.service': ['BrowserSupportService'],
            '@progress/kendo-angular-grid/dist/npm/js/selection.service': ['SelectionService'],
            '@progress/kendo-angular-grid/dist/npm/js/details.service': ['DetailsService'],
            '@progress/kendo-angular-grid/dist/npm/js/column.component': ['ColumnComponent'],
            '@progress/kendo-angular-grid/dist/npm/js/header-template.directive': ['HeaderTemplateDirective'],
            '@progress/kendo-angular-grid/dist/npm/js/col-group.component': ['ColGroupComponent'],
            '@progress/kendo-angular-grid/dist/npm/js/cell-template.directive': ['CellTemplateDirective'],
            '@progress/kendo-angular-grid/dist/npm/js/header.component': ['HeaderComponent'],
            '@progress/kendo-angular-grid/dist/npm/js/resizable.directive': ['ResizableContainerDirective'],
            '@progress/kendo-angular-grid/dist/npm/js/pager.component.js': ['PagerComponent'],
            '@progress/kendo-angular-grid/dist/npm/js/template-context.directive': ['TemplateContextDirective'],
            '@progress/kendo-angular-grid/dist/npm/js/footer.component': ['FooterComponent'],
            '@progress/kendo-angular-grid/dist/npm/js/selectable.directive': ['SelectableDirective'],
            '@progress/kendo-angular-grid/dist/npm/js/table-body.component': ['TableBodyComponent'],
            '@progress/kendo-angular-grid/dist/npm/js/field-accessor.pipe': ['FieldAccessorPipe'],          
            '@progress/kendo-angular-grid/dist/npm/js/list.component': ['ListComponent', 'SCROLLER_FACTORY_TOKEN','DEFAULT_SCROLLER_FACTORY']

        }
  }),
  uglify()
]
}
4

1 回答 1

1

为了使其工作,Angular 2 包的 Kendo UI 除了标准的 CommonJS 模块外,还必须打包为 ES2015 模块。

这并不像听起来那么大的障碍,我们已经在努力。您可以跟踪在包中包含 ES2015 模块的问题。

事实上,我在几分钟前刚刚发布了 Grid 包的更新版本(0.7.0)。去试试吧!

不太实用的选项是您在上面使用的 Rollup CommonJS 插件。它的配置很快就变得非常冗长。

于 2016-12-05T08:50:53.030 回答