我使用的是VS 2017中的Asp Core+webpack+ Angular 4模板。如何加载jQuery-ui,我将其放入webpack.config.vendor.js:
const treeShakableModules = [
'@angular/animations',
'@angular/common',
'@angular/compiler',
'@angular/core',
'@angular/forms',
'@angular/http',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/router',
'font-awesome/css/font-awesome.css',
'zone.js',
'virtual-keyboard',
'jquery-ui' //Here但我不认为这是正确的
什么是正确的方式来包含js/css文件到webpack?
谢谢
发布于 2018-01-28 13:47:37
您现在应该知道了,但是npm依赖项是在packages.json中添加的;这个应该放在Dependencies部分。您还需要在DevDependencies部分中使用'@types/jquery-ui',以便从TypeScript内部访问应该导入到您的代码中的API。修改文件并保存后,留出一两分钟让项目进行更新(您可以在Output窗口的npm部分看到进度)。可能还需要其他几个步骤(比如在页面中添加<script>和<link>指令),因为我自己并没有使用jQuery UI。
https://stackoverflow.com/questions/47038936
复制相似问题