requirejs在require.config()中设置以下代码后.
shim: {
'bootstrap': {
deps: ['jquery', 'css!../../../libs/font-awesome/css/font-awesome.min.css']
},
'bootstrapTheme': ['jquery', 'bootstrap'],
'metisMenu': {
deps: ['jquery']
}
在js中require('bootstrap'),requirejs会根据这个配置关系, 优先加载jquery以及font-awesome.min.css. 通过这样的方式可以很方便的管理一个第三方插件的依赖关系.
然后问题来了, webpack有没有类似的功能呢. 它的shim跟requirejs的shim好像不是同一种功能,作用不一样. 我该怎么实现?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。