Closed dkent600 closed 6 years ago
@dkent600 The PLATFORM.moduleName
traces each and every entry from bridge sources and bundles all of them, which increases the production build size. Since, we didn't included PLATFORM.moduleName
and recommended the below.
webpack.config.js
file, we need to add the path for Syncfusion Aurelia components in ModuleDependenciesPlugin
to load the aurelia-syncfusion-bridge
component source into webpack. For example, to render ejGrid
component, we need to add the following path.const { AureliaPlugin, ModuleDependenciesPlugin } = require('aurelia-webpack-plugin');
plugins: [
new AureliaPlugin(),
new ModuleDependenciesPlugin({
"aurelia-syncfusion-bridge": ["./grid/grid", "./grid/column"],
}),
....
....
]
aurelia-syncfusion-bridge
plugin with Aurelia in our main.js
file which is in src
folder.
import '../static/styles.css';
import 'font-awesome/css/font-awesome.css';
import 'bootstrap/dist/css/bootstrap.css';
import 'babel-polyfill';
import * as Bluebird from 'bluebird';
Bluebird.config({ warnings: { wForgottenReturn: false } });
export async function configure(aurelia) { aurelia.use .standardConfiguration() .developmentLogging() //register aurelia-syncfusion-bridge plugin here .plugin(PLATFORM.moduleName('aurelia-syncfusion-bridge'), (syncfusion) => syncfusion.ejGrid()); await aurelia.start(); await aurelia.setRoot(PLATFORM.moduleName('app')); }
We discussed the same in the below user guide documentation.
[Integration of aurelia-syncfusion-bridge with latest Aurelia skeleton-navigation-esnext-webpack](https://help.syncfusion.com/aurelia/getting-started/skeleton-esnext-latest)
Please let us know if you need further assistance on this.
Thanks for the response, that looks promising. However, when I follow these instructions I get:
"Unable to find module with ID: aurelia-syncfusion-bridge/grid/grid"
when running the application.
The problem ^^^ was mine: I have a vendor bundle with a separate webpack config file, and the ModuleDependenciesPlugin
bit needs to go in there, not in the app's webpack config file.
In reference to https://github.com/aurelia-ui-toolkits/aurelia-syncfusion-bridge/issues/63, a config-builder.js was provided in a .zip file here.
It uses
PLATFORM.moduleName
that enables webpack module resolution to work.However, version 1.0 of aurelia-syncfusion-bridge doesn't include this config-builder.js, and thus doesn't work with webpack at all.