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

これを機能させるには、標準の CommonJS モジュールに加えて、Kendo UI for Angular 2 パッケージを ES2015 モジュールとしてパッケージ化する必要があります。

これは思ったほど大きなハードルではなく、すでに取り組んでいます。パッケージの問題に ES2015 モジュールを含めるを追跡できます。

実際、数分前に Grid パッケージの更新バージョン (0.7.0) を公開したばかりです。試してみてください!

あまり実用的でないオプションは、上記で使用している Rollup CommonJS プラグインです。その構成は非常に冗長になります。

于 2016-12-05T08:50:53.030 に答える