I am not really sure if this is a bug or a feature request. I suspect feature request and the second part of this ticket is some weird side effect.
I am following the patterns laid out in the https://github.com/universal-vue/examples repository but trying to write it in TS. I'm able to write almost all aspects of my app in src/ as Typescript except src/server plugins.
When I try to include a typescript file in the server.config.js and serve the app I get the following error
However, if I append the file extension to server.config.js
// server.config.js
import { ExpressAdapter } from "@uvue/server";
export default {
adapter: ExpressAdapter,
plugins: [
"@uvue/server/plugins/gzip",
"@uvue/server/plugins/serverError",
"@uvue/server/plugins/static",
"@uvue/server/plugins/modernBuild",
"./src/server/apiPlugin.ts", // <-- suffix added so it can detected
],
};
It is able to detect the file but now it cannot find any imported files and I have to append the suffix to those as well
// src/server/apiPlugin.ts
import api from "./api.ts"; // <--- suffix added so it can detected
export default {
install(server) {
api(server);
},
};
The plugin gets installed and appears to work, However the Typescript compiler is not very happy about the inclusion of the .ts extension in the import.
An import path cannot end with a '.ts' extension. Consider importing './api' instead.ts(2691)
I am not really sure if this is a bug or a feature request. I suspect feature request and the second part of this ticket is some weird side effect.
I am following the patterns laid out in the https://github.com/universal-vue/examples repository but trying to write it in TS. I'm able to write almost all aspects of my app in
src/
as Typescript exceptsrc/server
plugins.When I try to include a typescript file in the
server.config.js
and serve the app I get the following errorHowever, if I append the file extension to
server.config.js
It is able to detect the file but now it cannot find any imported files and I have to append the suffix to those as well
The plugin gets installed and appears to work, However the Typescript compiler is not very happy about the inclusion of the
.ts
extension in the import.An import path cannot end with a '.ts' extension. Consider importing './api' instead.ts(2691)