-
Notifications
You must be signed in to change notification settings - Fork 254
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
npm package compatibility #276
Conversation
I would suggest to add This will prevent other files from being published to registry "files": [
"src/js",
"dist"
], We can add
|
@ankurk91 Thank you, done. |
Hey guys, @bakerkretzmar and I are talking about this right now. We're going to be moving from Travis to GitHub Actions, and we're pretty sure that would allow us to automate the NPM publish process. That's been our main concern until now was having to maintain the NPM package. We've not forgotten about this and appreciate the work you've put into it! |
This looks great @benallfree, thanks! Is there a reason you updated the My understanding of |
When someone would be consuming this npm package, they won't need to compile from source,. Let me know, if you need more explanation. |
I'm going to stick with using If we pointed it to My understanding is that if you aren't using a bundler at all, the Thanks again! |
We should point the /~https://github.com/laravel/echo/blob/master/package.json#L19
Laravel Mix, will not convert ES6 to ES5 for this package. Webpack official docs recommends to do the same. https://webpack.js.org/guides/author-libraries/#final-steps So our main entry should look like this, notice: it is not minified.
|
That's not correct. Webpack, Rollup, Parcel, Microbundle, and all other bundlers I know of will prefer @ankurk91 is correct that So either way, I assume Laravel Mix will pick up Since Ziggy is never a cjs/node package, But again it's mostly academic since I don't think any modern bundler will ever resolve to the |
@ankurk91 @benallfree you're right, we'll change this back. I hadn't found that particular page in Webpack's docs when I was reading about this, and I didn't take a close enough look at Ziggy's own build config to see what we're targeting. I really appreciate the follow-up and your patience, thank you! |
This PR proposes a few
package.json
changes for npm compatibility.laravel-ziggy
since the ziggy name is already taken on npm.qs
out ofdevDependencies
, because (see 3 below)...module
directive as an es6 source, and the package.json spec advises to have abrowser
entry point as well.prepublishOnly
hook to build scripts right beforenpm publish
files
directive to publish only necessary files to npm's registryIf this PR is accepted, please publish to npm (see #277)