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

Should we move deps into dev deps? #7

Open
hsablonniere opened this issue Jul 21, 2016 · 2 comments
Open

Should we move deps into dev deps? #7

hsablonniere opened this issue Jul 21, 2016 · 2 comments

Comments

@hsablonniere
Copy link
Contributor

The package published on NPM already contains the dependencies like prism or insert-css bundled in the minified. Maybe we should move all the deps into devDeps?

@mojavelinux WDYT?

@hsablonniere
Copy link
Contributor Author

hsablonniere commented Aug 3, 2016

So the problem is not that simple. We should provide 2 ways to use the plugin (and all other plugins too) :

  • require() the module with a bundler like browserify
  • include the minified <script> tag manually with every dependencies bundled in it.

This means that we may change the "main" section of the package.json from "./dist/bespoke-prism.min.js" to "./lib/bespoke-prism.js".

@mojavelinux
Copy link
Member

Exactly. According to the Browserify docs, the main field should point to the uncompiled JavaScript at ./lib/bespoke-prism.js. Browserify then handles the compilation in the user's build script. However, that means any libraries which the module requires must be declared under dependencies (or else they have to be declared explicitly in the user's package.json).

As it stands now, the dependencies are redundant since the main field points to the compiled (bundled) JavaScript.

include the minified <script> tag manually with every dependencies bundled in it.

I was recently alerted to https://npmcdn.com. It encourages you not to put the dist folder in the git repository. Instead, you package it inside the npm module and publish it along with the package. npmcdn then allows you to reference that file through its proxy.

I find it incredibly annoying to have to check in the dist file for every change to the module, so I think we should stop doing that. The compiled JavaScript file is a build artifact and build artifacts don't belong in the git repository.

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

2 participants