I can not add a jquery library to my jhipster project, I think it's specific to webpack,
here is an exemple with fullcalendar, but i have the same probleme with all jquery plugin
all is in src/main/webapp/app/layouts/main/main.component.ts & webpack/webpack.common.js
if i try this:
main.component.ts
import $ from 'jquery';
import 'fullcalendar';
webpack.common.js
module: {
rules: [
{ test: /fullcalendar\/dist\/.+\.js/, loader: 'imports-loader?$=jquery' },
{ test: /bootstrap\/dist\/js\/umd\//, loader: 'imports-loader?jQuery=jquery' },
.... i got an error with: ERROR TypeError: jquery_1.default is not a function
if i try like the exemple on fullcalendar doc:
module: {
rules: [
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader' },
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
i got error like :
[at-loader] ./src/main/webapp/app/app.module.ts:18:5 TS2539: Cannot assign to 'FullcalendarExempleAppModule' because it is not a variable.
[at-loader] ./src/main/webapp/app/layouts/main/main.component.ts:9:95 TS2339: Property 'metadata' does not exist on type 'typeof Reflect'.
[at-loader] ./src/main/webapp/app/app.module.ts:18:5 TS2539: Cannot assign to 'FullcalendarExempleAppModule' because it is not a variable.
jquery_1.default is not a function
I tried other tips for hours, but none works ... i dont understand why add a simple jquery plugin seems so hard
i put a jhipster project exemple on github (because i dont know how make a jsfiddle of this project ...) :
https://github.com/brynnlow/jhipster-fullcalendar-exemple.git