I recently updated the Aurelia CLI to latest, and followed the docs on how to configure my aurelia.json
file, but I get the following error when I try to use moment: error TS2304: Cannot find name 'moment'.
and error TS2339: Property 'datetimepicker' does not exist on type 'JQuery<HTMLElement>'.
when I try to use tempusdominus.
Here is how aurelia.json
is configured:
"name": "MigrationPortal",
"type": "project:application",
"bundler": {
"id": "cli",
"displayName": "Aurelia-CLI"
},
"httpProtocol": {
"id": "http1",
"displayName": "HTTP/1.1"
},
"build": {
"targets": [
{
"id": "aspnetcore",
"displayName": "ASP.NET Core",
"output": "wwwroot/scripts",
"index": "wwwroot/index.html",
"baseDir": "./wwwroot",
"baseUrl": "scripts"
}
],
"options": {
"minify": "ci-dev & stage & prod",
"sourcemaps": "local & dev & ci-dev & stage",
"rev": "ci-dev & stage & prod"
},
"bundles": [
{
"name": "app-bundle.js",
"source": [
"**/*.{js,json,css,html}"
]
},
{
"name": "vendor-bundle.js",
"prepend": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/moment/min/moment-with-locales.min.js",
"node_modules/popper.js/dist/umd/popper.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js",
"node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js",
"node_modules/requirejs/require.js"
],
"dependencies": [
"aurelia-bootstrapper",
"aurelia-loader-default",
"aurelia-pal-browser",
{
"name": "aurelia-testing",
"env": "dev"
},
"text"
]
}
],
"loader": {
"type": "require",
"configTarget": "vendor-bundle.js",
"includeBundleMetadataInConfig": "auto",
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": false
}
]
},
"copyFiles": {
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.eot": "wwwroot/simple-line-icons/fonts",
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.svg": "wwwroot/simple-line-icons/fonts",
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.ttf": "wwwroot/simple-line-icons/fonts",
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff": "wwwroot/simple-line-icons/fonts",
"node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff2": "wwwroot/simple-line-icons/fonts",
"node_modules/font-awesome/fonts/fontawesome-webfont.eot": "wwwroot/font-awesome/fonts",
"node_modules/font-awesome/fonts/fontawesome-webfont.svg": "wwwroot/font-awesome/fonts",
"node_modules/font-awesome/fonts/fontawesome-webfont.ttf": "wwwroot/font-awesome/fonts",
"node_modules/font-awesome/fonts/fontawesome-webfont.woff": "wwwroot/font-awesome/fonts",
"node_modules/font-awesome/fonts/fontawesome-webfont.woff2": "wwwroot/font-awesome/fonts",
"node_modules/font-awesome/fonts/FontAwesome.otf": "wwwroot/font-awesome/fonts"
}
},
"platform": {
"id": "aspnetcore",
"displayName": "ASP.NET Core",
"output": "wwwroot/scripts",
"index": "wwwroot/index.html",
"baseDir": "./wwwroot",
"baseUrl": "scripts"
},
"transpiler": {
"id": "typescript",
"displayName": "TypeScript",
"fileExtension": ".ts",
"dtsSource": [
"./custom_typings/**/*.d.ts"
],
"source": "src/**/*.ts"
},
"markupProcessor": {
"id": "maximum",
"displayName": "Maximum Minification",
"fileExtension": ".html",
"source": "src/**/*.html"
},
"cssProcessor": {
"id": "sass",
"displayName": "Sass",
"fileExtension": ".scss",
"source": "src/**/*.scss"
},
"editor": {
"id": "vscode",
"displayName": "Visual Studio Code"
},
"testFramework": {
"id": "jasmine",
"displayName": "Jasmine"
},
"unitTestRunner": {
"id": "karma",
"displayName": "Karma",
"source": "test/unit/**/*.ts"
},
"paths": {
"root": "src",
"resources": "resources",
"elements": "resources/elements",
"attributes": "resources/attributes",
"valueConverters": "resources/value-converters",
"bindingBehaviors": "resources/binding-behaviors"
}
Have I missed something in my configuration? Is Typescript causing an issue? I would appreciate any help or advice I can get on this.