question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`dist` not included in default publish experience

See original GitHub issue

Current Behavior

Currently the scaffolded package.json looks like this:

{
  "source": "src/index.ts",
  "main": "index.js",
  "umd:main": "dist/podcats.umd.production.js",
  "module": "dist/podcats.es.production.js",
  "typings": "dist/index.d.ts",
  "scripts": {
    "start": "tsdx watch",
    "build": "tsdx build",
    "test": "tsdx test"
  },
  "devDependencies": {
// etc
  }
}

when i publish to npm, nothing in the dist folder gets included. this could partially be because of the .gitignore (in which case we should add an .npmignore?) but i think the "main": "index.js", line is also a problem. I’m quite inexperienced at this so i’m not sure how to fix but i’m sure you can.

Expected behavior

i can just type ‘yarn publish’ at the root level and it “just works”

Suggested solution(s)

fix “main” field?

Your environment

Software Version(s)
TSDX 0.2.5
TypeScript 3.2.4
Browser chrome
  System:
    OS: macOS High Sierra 10.13.4
    CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
    Memory: 127.70 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 11.0.0 - /usr/local/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Safari: 11.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jaredpalmercommented, Jan 31, 2019

@sw-yx try 0.3.0

0reactions
jaredpalmercommented, Jan 31, 2019

That’s interesting about npx.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Link and publish not the package directory but it's child dist ...
The problem with this is that I need to publish not the package folders, but their dist folders instead, as well as using...
Read more >
How to npm publish specific folder but as package root
You need to publish the dist folder · Specify the rootDir . This directory will have all the source code and it should...
Read more >
Publish your app - Play Console Help
There are three types of publishing status: ... Every possible status for apps, updates, and items is described below. ... Your app has...
Read more >
Usage of Angular libraries published to npm
Libraries are published as npm packages, usually together with schematics that ... If the package of your library does not include typings and...
Read more >
Working With Files
The main convention is provided by the Base Plugin, which defaults to creating archives in the $buildDir/distributions directory and typically uses archive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found