【发布时间】:2019-05-08 12:22:28
【问题描述】:
我创建了一个简单的 typescript 项目来导出 ENUMS,我成功编译了该项目。 tsconfig.json 和 package.json 下面。 我使用 npm 命令打包它并 npm 发布它。我将相同的包安装到一个新项目中,并使用代码导入相同的包
import Numbers = require('@hk18/export/dist');
虽然我想成为那样的人
import Numbers = require('@hk18/export');
为什么会在包中包含dest文件夹?
{ "compilerOptions": {
"module": "commonjs",
"target": "es5",
"outDir": "./dist",
"moduleResolution": "node",
"declaration": true }, "include": [
"src/**/*.ts",
"index.ts" ] }
___________________________________________________________
{ "name": "@hk18/export", "version": "2.0.0", "description": "test project to create npm package", "main": "index.js", "scripts": {
"build": "tsc",
"build:watch": "tsc --watch",
"lint": "tslint --project \"./tsconfig.json\"",
"test": "mocha --reporter spec",
"docs": "typedoc --out docs src",
"gh-pages": "rimraf docs && npm run docs && gh-pages -d docs" }, "author": "HK", "license": "ISC", }
【问题讨论】:
标签: node.js typescript npm