Telerik Angular2 汇总问题
Telerik Angular2 rollup issue
使用 Telerik 网格模块和在 网格模块中指定的汇总设置无法获得 '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()
]
}
为了使其正常工作,除了标准的 CommonJS 模块之外,Kendo UI for Angular 2 包必须打包为 ES2015 模块。
这并没有听起来那么大的障碍,我们已经在努力了。您可以跟踪 Include ES2015 modules in package 问题。
事实上,我刚刚在几分钟前发布了 Grid 包的更新版本 (0.7.0)。去试试吧!
不太实用的选项是您在上面使用的 Rollup CommonJS 插件。它的配置很快就变得非常冗长。
使用 Telerik 网格模块和在
这是我命名的导出:
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()
]
}
为了使其正常工作,除了标准的 CommonJS 模块之外,Kendo UI for Angular 2 包必须打包为 ES2015 模块。
这并没有听起来那么大的障碍,我们已经在努力了。您可以跟踪 Include ES2015 modules in package 问题。
事实上,我刚刚在几分钟前发布了 Grid 包的更新版本 (0.7.0)。去试试吧!
不太实用的选项是您在上面使用的 Rollup CommonJS 插件。它的配置很快就变得非常冗长。