亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

webpack packaging jQuery plugin - Stack Overflow
黃舟
黃舟 2017-06-26 10:50:32
0
2
993

In multiple pages, first use providePlugin to expose jQuery to the world

var providePlugin = new webpack.ProvidePlugin({
    $: 'jquery',
    jQuery: 'jquery',
    'window.jQuery': 'jquery',
    'window.$': 'jquery'
});

I don’t know what to do when referencing the jQuery plug-in. If it is an ordinary js plug-in, just require it. However, some plug-ins include both js, css, and images. If you need to introduce such a set when using it on every page, it will be very troublesome. Another problem is that after the CSS is introduced, it is packaged into HTML by the style-loader, so the image path referenced in the CSS is incorrect. It is really painful. Is there any mature solution?

Please give me some advice.

黃舟
黃舟

人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!

reply all(2)
僅有的幸福

So in this case, it is not suitable to use webpack. Use gulp instead. webpackis suitable for single-page applications

給我你的懷抱

I have answered the reference method of jQuery before, please post the address directly here:
/q/10...

Just modify the configuration in webpack.base.conf.js

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template