Reputation: 6015
I use Asp Core+webpack+ Angular 4 template from VS 2017.how do I load jQuery-ui, I put it to 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
but I don't think it is correct
what is the right way to include js/css files to webpack?
thanks
Upvotes: 0
Views: 402
Reputation: 1727
You should know by now, but npm dependencies are added in packages.json
; this one should go in the Dependencies
section. You will also need '@types/jquery-ui'
in the DevDependencies
section to access the API from inside TypeScript, which you should import in your code. Once you modify the file and save, allow a minute or two for the project to update (you can see the progress in the npm section of the Output Window). There may be several other steps needed (like adding <script>
and <link>
directives in your page) as I did not use jQuery UI myself.
Upvotes: 1