Closed goldylucks closed 6 years ago
@goldylucks
This is curious. 🤔 Can you give me some more details on how you're packaging your application - Node version, webpack version, .babelrc? 🙂
does it matter?
I've installed the package thru yarn, and in package.json
, the main entry point is src/index.js
, and there's no build/dist folder.
Created a fresh repo to reproduce :)
Ah! I get it now. 🙂
Right ... so the thought-process I had while building this was that it would stay in its source version, and that I would leave the bundling to the user. Basically provide everything as is.
Just out of curiosity, how are you bundling it? 🙂 I spun this component off from a project that I worked on. In that project, importing this component and running the project source through webpack with babel-preset-react
and babel-preset-env
worked without any errors.
Would like to know how you're bundling this so that I can see how others are using this package and if, like you pointed out, the dist/build version makes more sense than the source version. 😄
well that's how npm packages work. a downloadable package is expected to be pure .js
production ready files. otherwise, leave it as a gist, codebin, or just the repo, but this is how packages are used:
$ yarn add package-name
import 'packageName' from 'package-name
Of course you won't have errors running it through babel
, but babel is not supposed to be used in production.
Why not upload to npm
the production ready version, like the rest of the world?
Help me understand your thought process here :)
@goldylucks
Why not upload to npm the production ready version, like the rest of the world?
Yeah. You're probably right. Will fix this in a day or two. 🙂
I just figured that since this is a component that you'd pull into a react application, the build process that the end-user runs before production would suffice. But apparently I assumed incorrectly.
Thanks for raising this. 😄
I have same error. Please fix it.
Hey, @goldylucks @ltdat287! 👋
We've updated the publishing process in v.1.1.0.
Do try the new version and let us know if it fixes your issues. 🙂
Marking this issue as closed. 😄
I ended up making more changes, don't remember exactly why, you are welcome to have a look and ask any Qs.
after I run
$ yarn add react-input-trigger
, I've ended up with this:I got the dev build instead the prod build. Please fix so I can use this cool package :)
as a workaround for now I've copy pasted the package into my source code, and it works