Yes I am trying to use webpack. webpack runs (and produces the bundle) OK but I am getting an error.
Here is a link to a sample (supplied by SyncFusion) which I am modifying --
Project
require("jquery.easing");
require("bootstrap-webpack");
require("./SyncFusion/Scripts/jquery-1.10.2.min.js");
require("./SyncFusion/Scripts/jquery.globalize.min.js");
require("./SyncFusion/Scripts/angular.min.js");
require("./SyncFusion/Scripts/ej.web.all.min.js");
require("./SyncFusion/Scripts/ej.widget.all.min.js");
require("./SyncFusion/Scripts/ej.widget.angular.min.js");
require("./SyncFusion/Scripts/ej.reportviewer.js");
require("./SyncFusion/themes/bootstrap.min.css");
require("./SyncFusion/themes/default-theme/ej.widgets.all.css");
require("./SyncFusion/themes/default.css");
require("./SyncFusion/themes/default-responsive.css");
require("./src/app.js");
require("./src/components/SfReportViewer/sfReportViewer.js");
Webpack.config.js
'use strict';
var path = require('path');
var buildPath = path.resolve(__dirname, 'build');
var webpack = require("webpack");
function absPath(_path) {
return path.join(__dirname, _path);
}
var config = {
context: __dirname,
entry: "./entry.js",
output: {
path: path.join(__dirname, './dist'),
filename: 'bundle.js',
publicPath: 'http://localhost:3001/app/dist/'
},
module: {
loaders: [
{
test: /\.(jpe?g|png|gif|svg|woff|woff2|eot|ttf)(\?v=[0-9].[0-9].[0-9])?$/,
loader: 'file?name=/fonts/[sha512:hash:base64:7].[ext]',
exclude: /node_modules\/(?!font-awesome)/
},
{
test: /bootstrap\/js\//,
loader: 'imports?jQuery=jquery'
},
{
test: /\.css$/,
loader: 'file?/[sha512:hash:base64:7].[ext]',
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"jQuery.$.fn" : "jquery",
"window.jQuery": "jquery",
"root.jQuery": "jquery",
})
]
};
// window.ej = window.Syncfusion = window.Syncfusion || {};
module.exports = config;
Error
bundle.js:14669 TypeError: Cannot read property 'id' of undefined
at Object._renderPopupPanelWrapper (http://localhost:60360/app/dist/bundle.js:14807:684856)
at Object._render (http://localhost:60360/app/dist/bundle.js:14807:680184)
at Object._init (http://localhost:60360/app/dist/bundle.js:14807:673623)
at Object.<anonymous> (http://localhost:60360/app/dist/bundle.js:14807:14640)
at jQuery.$.fn.(anonymous function) [as ejDropDownList] (http://localhost:60360/app/dist/bundle.js:15875:26)
at Object._renderToolBar (http://localhost:60360/app/dist/bundle.js:14807:2715421)
at Object._renderViewer (http://localhost:60360/app/dist/bundle.js:14807:2733021)
at Object._init (http://localhost:60360/app/dist/bundle.js:14807:2710213)
at Object.<anonymous> (http://localhost:60360/app/dist/bundle.js:14807:14640)
at jQuery.$.fn.(anonymous function) [as ejReportViewer] (http://localhost:60360/app/dist/bundle.js:15875:26) <div id="container" ej-reportviewer="ej-reportviewer" e-reportserviceurl="samplevalue" e-processingmode="mode" e-reportpath="path" style="height:680px" class="e-reportviewer e-js" tabindex="">