I've been spending the last couple of days experimenting with my basic ASP.NET Core website set up for Typescript 2.9, but unfortunately, I haven't made much progress. My main goal is to keep the front-end simple, with just single Vue apps on each page and avoid complex build systems or components.
My current tsconfig.json file looks like this:
{
"compilerOptions": {
"declaration": true,
"mapRoot": "/js/",
"module": "esnext",
"removeComments": true,
"sourceMap": true,
"target": "esnext"
},
"compileOnSave": true
}
(I've tried different modules - es6, es5, and none as well)
In my wwwroot/js folder, there's a Site.ts file structured as follows:
import { Vue } from "./types/vue";
var _mixin: any;
var _vue = new Vue({
el: '#vueheader',
mixins: [_mixin],
data: {},
methods: {},
mounted: function () {
},
});
Additionally, in the wwwroot/js/types folder, I have 5 d.ts files from Vue, along with vue.js file. Although TypeScript compiles correctly into a js file, when I visit the main page, Chrome displays a "404, file not found /types/vue" error.
This is how the compiled Site.js looks like:
import { Vue } from "./types/vue";
var _mixin;
var _vue = new Vue({
el: '#vueheader',
mixins: [_mixin],
data: {},
methods: {},
mounted: function () {
},
});
//# sourceMappingURL=/js/Site.js.map
The HTML code includes this link:
If anyone has any suggestions, please avoid recommending complicated build systems like Webpack. I prefer not to add unnecessary dependencies to my build process.