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

Idea: Option for target NodeJS and generate *.min.js #4

Open
3 tasks
juancarlospaco opened this issue Oct 25, 2018 · 3 comments
Open
3 tasks

Idea: Option for target NodeJS and generate *.min.js #4

juancarlospaco opened this issue Oct 25, 2018 · 3 comments

Comments

@juancarlospaco
Copy link
Contributor

juancarlospaco commented Oct 25, 2018

  • Implement an option to target NodeJS js -d:nodejs -d:release.
  • When used it should generate a *.js and *.min.js.
  • What else is needed, lets say I want to publish my Nim module as NPM module ❔

For the "Backend" of this idea please have a look at:

@kaushalmodi
Copy link
Owner

That's a great idea. FYI, I have no JS or npm knowledge. But if you are leading this effort, I follow that PR closely (you can start a WIP PR as you get something going), and I can chime in wherever I can help.

Thanks.

@skellock
Copy link

skellock commented Oct 25, 2018

To publish to npm, you need a file called package.json. There's a few keys you should have:

{
  "name": "my-lib-rulez",
  "version": "1.0.1",
  "license": "MIT",
  "files": ["readme.md", "dist"],
  "main": "dist/my-lib-rules.min.js"
}

Your build process should compile (optionally minify -- though i wouldn't sweat it these days) and drop it in a .gitignore'd dist directory (name is subjective - though dist is popular).

To publish, you type npm publish. npm then makes a tarball based on the packing list of files/dirs found in your files key in your package.json and uploads that to the central npm repository for everyone to access.

The tooling landscape in JavaScript is vast, but by sticking to the bare minimum steps, it's actually quite simple.

EDIT 1,2: i can't type json in a textarea to save my life.

@juancarlospaco
Copy link
Contributor Author

I think that calling js -d:nodejs -d:release should be relatively easy.
The rest might need more research or someone with experience on NPM.

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