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

npm install material-design-lite doesn't have default entry point #1214

Closed
ghost opened this issue Jul 26, 2015 · 3 comments
Closed

npm install material-design-lite doesn't have default entry point #1214

ghost opened this issue Jul 26, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 26, 2015

Doing

npm install material-design-lite

then in my code

require('material-design-lite')

The require doesn't point to a js file, have to do it manually with

require('material-design-lite/material.min.js')

Please consider updating the package.json to point to the correct javascript files when requiring it from npm.

@Swatinem
Copy link

Dupe of #833 I would say. An external contributor is working on a patch, hopefully with results soon :-)

@Garbee Garbee closed this as completed Jul 26, 2015
@olegt-indicee
Copy link
Contributor

I think this issue should be re-opened. The workaround above require('material-design-lite/material.min.js') does not work when I use webpack's CommonsChunkPlugin to extract vendor libraries:

webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.dist.js')

I get the following error at compile time:

ERROR in multi vendor
Module not found: Error: Cannot resolve module 'material-design-lite' in /project-path/myproject
 @ multi vendor

And my vendor.dist.js has this error:

...
__webpack_require__(324);
(function webpackMissingModule() { throw new Error("Cannot find module \"material-design-lite\""); }());
...

Manually adding "main": "dist/material.js” or "main": "dist/material.min.js” fixes this issue. Obviously, manual code editing is not an option for when building in Jenkins.

I've created a fork with a fix, please consider merging it in:
#2000

@alhajee
Copy link

alhajee commented Jul 10, 2017

i had the same issue too but i managed to fix it by adding "material-design-lite": "^1.3.0" to the dependencies in my package.json then i ran npm install once again

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

4 participants