Reputation: 135
Using Telerik Grid module and rollup settings specified in the StackOverflow question Grid module is not able to get 'orderBy'. Other modules like GridModule, SharedModule, IntlService are getting resolved.
Here are my named exports:
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()
]
}
Upvotes: 1
Views: 189
Reputation: 106494
In order for this to work, the Kendo UI for Angular 2 packages must be packaged as ES2015 modules in addition to the standard CommonJS modules.
This is not as big hurdle as it sounds and we're already working on it. You can track the Include ES2015 modules in package issue.
In fact, I just published an updated version (0.7.0) of the Grid package few minutes ago. Go try it out!
The less practical option is the Rollup CommonJS plugin that you're using above. Its configuration gets really verbose really quick.
Upvotes: 1