I'm trying to turn an older typescript project into a library for a new vue.js project. The older package is configured to output to ./lib/
with tsconfig.json
, and package.json
includes all of the "this is where my library is" options I can think of. tsc
compiles everything to lib/
in the older package, and npm link
is used to connect the packages together.
My problem is that no matter what I've tried, I can't seem to remove the lib/
segment from my imports, like import { baz } from "older/common/thing"
instead of import { baz } from "older/lib/common/thing"
. Should I just live with it? Or is there something else I should be doing for prettier imports?
package.json
(partial)
{
"main": "./lib/index.js",
"module": "./lib/index.js",
"types": "./lib/index.d.ts",
}
tsconfig.json
{
"compilerOptions": {
"module": "es6",
"target": "es6",
"moduleResolution": "node",
"noImplicitAny": true,
"noUnusedLocals": true,
"removeComments": true,
"preserveConstEnums": true,
"allowSyntheticDefaultImports": true,
"importHelpers": true,
"sourceMap": true,
"typeRoots": [
"typings",
"node_modules/@types"
],
"outDir": "./lib",
"declaration": true
},
"include": [
"app/source/**/*",
"test/**/*"
],
"exclude": [
"node_modules"
]
}