Я бы хотел использовать плагин jquery на машинописной странице моего Aurelia SPA. Этот плагин называется morelines
Вот мое текущее решение:
мой файл машинописи: post.ts
import './jquery.morelines'
export class Post {
attached() {
$('.card__description--details').moreLines({
linecount: 6,
baseclass: 'b-description',
basejsclass: 'js-description',
classspecific: '_readmore',
buttontxtmore: "",
buttontxtless: "",
animationspeed: 400
});
}
}
плагин jquery.morelines.js
Код, видимый здесь на github
(function ( $ ) {
$.fn.moreLines = function (options) {
...
}
}(jQuery));
my tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"sourceMap": true,
"target": "es5",
"module": "amd",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": true,
"moduleResolution": "node",
"lib": ["es2017", "dom"],
"baseUrl": "src"
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts"
],
"atom": {
"rewriteTsconfig": false
}
}
Работает во время выполнения, но при объединении возникли ошибки (au build
)
![enter image description here](https://i.stack.imgur.com/GBWHf.png)
![enter image description here](https://i.stack.imgur.com/ivzEH.png)
Как избавиться от этих ошибок? Как правильно ссылаться на этот javascript плагин jquery внутри моего машинописного файла?