Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json main #8

Open
pqvst opened this issue Nov 9, 2015 · 2 comments
Open

package.json main #8

pqvst opened this issue Nov 9, 2015 · 2 comments

Comments

@pqvst
Copy link

pqvst commented Nov 9, 2015

Wouldn't it make more sense if "main" in package.json pointed to "datatable.min.js"? It seems weird that it points to the src js file. As a user I want to use the built version - not the source file.

That way I could simply include ractive-datatable in browserify:

browserify([
    "ractive",
    "ractive-datatable"
]);

I guess for now I have to do something like:

browserify([
    "ractive",
    "./node_modules/ractive-datatable/datatable.min.js"
]);

Or?

@JonDum
Copy link
Owner

JonDum commented Nov 9, 2015

For me and my team's use case it's more efficient to point to the src, since it doesn't contain extra UMD loaders and webpack will pick it up like a first class module. Before, I didn't even include a built version. I include it as an after thought mainly for people with no build systems at all.

I'm not that familiar with Browserify, though. Why can't it read the package.main and use the version in src?

@paulocoghi
Copy link

I agree with @JonDum . When you don't use a build system, use directly datatable.min.js.

I am using rollup to bundle some packages with my own, and the ones that point main to a build file spoils things a bit, because the extra UMD loaders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants