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 install does not give a usable module to require #1623

Closed
jeromecovington opened this Issue Jul 31, 2015 · 10 comments

Comments

Projects
None yet
3 participants
@jeromecovington

jeromecovington commented Jul 31, 2015

We can:

npm install --save modernizr

It seems that we still need to:

./bin/modernizr

Before we can:

require('modernizr');

This seems odd within the npm ecosystem. Is there a better way?

@patrickkettner

This comment has been minimized.

Member

patrickkettner commented Jul 31, 2015

in what way do you need to ./bin/modernizr before you require it?

@jeromecovington

This comment has been minimized.

jeromecovington commented Aug 1, 2015

Do you not need to build modernizr within the the node_modules/modernizr directory that you get when you npm install modernizr in order to then have a modernizr.js that can be required via node/CommonJS/Browserify?

@patrickkettner

This comment has been minimized.

Member

patrickkettner commented Aug 1, 2015

Yes. The module is for the builder, not for the feature detects themselves.

On Sat, Aug 1, 2015, 3:39 PM Jerome Covington notifications@github.com
wrote:

Do you not need to build modernizr within the its node_modules directory
in order to then have a modernizr.js that can be required via
node/CommonJS/Browserify?


Reply to this email directly or view it on GitHub
#1623 (comment)
.

@patrickkettner

This comment has been minimized.

Member

patrickkettner commented Aug 1, 2015

Closing as AS DESIGNED

@jeromecovington

This comment has been minimized.

jeromecovington commented Aug 1, 2015

From my perspective, the node_modules dir of my app can/should be able to be a black box that does not need any more tinkering to allow my app to "just work" when somebody runs npm install within my project root, with "modernizer" listed in my package.json as a dependency. Ah well.

@patrickkettner

This comment has been minimized.

Member

patrickkettner commented Aug 1, 2015

You are confusing the purpose of he module. It does just work - for its
intended purpose. A code generator. If you want to use modernizr as a
dependency for your front end code, then you should generate that
standalone file and check it in directly, rather than using an npm module.

On Sat, Aug 1, 2015, 4:33 PM Jerome Covington notifications@github.com
wrote:

From my perspective, the node_modules dir of my app can/should be able to
be a black box that does not need any more tinkering to allow my app to
"just work" when somebody runs npm install within my project root, with
"modernizer" listed in my package.json as a dependency. Ah well.


Reply to this email directly or view it on GitHub
#1623 (comment)
.

@jeromecovington

This comment has been minimized.

jeromecovington commented Aug 1, 2015

Ok, thanks for clarifying. Personally I am working towards a future where all the dependencies of my project, both serverside and front end, can be managed within the "dependencies" object of my package.json. Understood that is not the intended purpose of this module.

@patrickkettner

This comment has been minimized.

Member

patrickkettner commented Aug 1, 2015

Good luck!

On Sat, Aug 1, 2015, 5:49 PM Jerome Covington notifications@github.com
wrote:

Ok, thanks for clarifying. Personally I am working towards a future where
all the dependencies of my project, both serverside and front end, can be
managed within my package.json. Understood that is not the intended
purposes of this module.


Reply to this email directly or view it on GitHub
#1623 (comment)
.

@g-borgulya

This comment has been minimized.

g-borgulya commented Mar 8, 2018

I understand now that this is "AS DESIGNED" but I think that doesn't necessarily mean that this design is a good idea. People manage their projects with npm, automate their builds and environments with docker and other useful tools. If this project doesn't follow the logic of these modern tools then it's likely that it is simply not worth using Modernizr for modern projects.

I'm not deeply understanding the core ideas behind Modernizr, I just know that I'd expect an npm package that could be a non-global dependency of my projects, and that could be used something like:

import {passiveeventlisteners} from 'Modernizr'

If it's not like this then it seems to be easier if I write the feature checking myself than changing my development and production scripts to have Modernizr customized and built.

@patrickkettner

This comment has been minimized.

Member

patrickkettner commented Mar 8, 2018

PRs are welcomed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment