I'm trying to switch to webpack a big project using lazyload but as the script needs to be loaded on the top on the page, I do not manage to make it work.
The config looks like this:
module.exports = {
entry: {
head: [
'./custom-lazyload.js', // which does `import lazyload from 'lazyloadjs'`
],
global: [
// some files
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
})
]
}
I got tree generated files: head.js, global.js and vendor.js but the webpack "bootstrap" is in the vendor and the vendor is huge, I do not want to load it on the top of the page.
The head.js start like this: webpackJsonp([16],{ and so the webpackJsonp function does not exists.
Do you have by any change a working example with webpack ? or an idea on how to make it work ?
Sorry never tried to do so. What I would do is inline lazyload script in the HTML page rather than trying to bundle it somehow with webpack. Dirty but works
Hi,
I'm trying to switch to webpack a big project using lazyload but as the script needs to be loaded on the top on the page, I do not manage to make it work.
The config looks like this:
I got tree generated files:
head.js
,global.js
andvendor.js
but the webpack "bootstrap" is in the vendor and the vendor is huge, I do not want to load it on the top of the page.The head.js start like this:
webpackJsonp([16],{
and so the webpackJsonp function does not exists.Do you have by any change a working example with webpack ? or an idea on how to make it work ?
Thank you