Skip to content

Conversation

@rjcortese
Copy link

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Wanted to be able to use this project by importing an ES6 module like:
import { NoSleep } from './nosleep.js';

This does just that. A user can copy the two files in dist/ES6 and then import in another module.

Breaking Changes

Additional Info

No breaking changes as it is... but it isn't integrated well with other parts of the package... basically have two versions of src. There has gotta be a better way... could use some input from the maintainer as to how to structure it.
Might also be what #84 looks to fix.

@richtr
Copy link
Owner

richtr commented Mar 19, 2021

Does the following not work for you?

import NoSleep from 'nosleep.js'

I’m not sure what the specific use case is to import this from a relative path.

@rjcortese
Copy link
Author

It did not work for me. I believe all of that involves using Node runtime or a bundler or other module systems.
See the note in this section: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#importing_features_into_your_script

I'm just wanting to use the ES6 browser based import mechanism.

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

Successfully merging this pull request may close these issues.

2 participants