leafo / sticky-kit

A jQuery plugin for creating smart sticky elements
http://leafo.net/sticky-kit
2.9k stars 517 forks source link

cannot find module 'sticky-kit' #201

Open dmitrylebedev opened 8 years ago

dmitrylebedev commented 8 years ago

Hi! Do you plan support for ES6 modules?

leafo commented 8 years ago

I don't see a reason not to. I'm considering a rewrite from coffeescript -> es6 at some point.

scotthovestadt commented 8 years ago

@leafo The error "cannot find module" happens because the package.json is incorrect. The file is located at dist/sticky_kit.js but the package.json "main" is set to sticky_kit.js. If you fix this, it'll at least be loosely compatible with webpack/es6.

scotthovestadt commented 8 years ago

Note that I see the correct value for main in the GitHub repo but not in the package.json fetched from NPM.

fregante commented 8 years ago

Until the latest package.json is pushed to npm, you can use it as

import 'sticky-kit/dist/sticky-kit.js';

or

require('sticky-kit/dist/sticky-kit.js');
km-tr commented 7 years ago

Do not publish to npm? @leafo

Webbist-dev commented 6 years ago

I was having a similar issue but via JSPM - import 'sticky-kit/dist/sticky-kit.js'; does solve my build process not finding the js file, even with the package.json pointing to sticky-kit.js (the correct file) When importing I get an empty object only while still running the build process (grunt) - If I stop the process and restart it all is well.

vega231 commented 5 years ago

@leafo any chances to update package.json in NPM repository?