jeromegn/Backbone.localStorage

Webpack required to build usable bacbone.localstorage.js file in browser?

chill117 opened this issue · 4 comments

I am trying to use Backbone.localStorage in the browser, but I cannot simply include the current build/backbone.localStorage.js build file like this:

<script src="path/to/deps/backbone.localStorage.js"></script>

Because I get this error:

Uncaught ReferenceError: module is not defined

I am now attempting to use webpack to create a build file that I can use, but I would really like to avoid adding webpack as a dependency to my project.

Thanks!

Hi @chill117, thanks for reporting this. I've marked this as a bug to be resolved before v2.0 can go out.

It seems Webpack is building an output file that assumes the module global exists, which isn't the case in a browser environment.

Hi @chill117 - this should be resolved in the latest .rc2 and the downloaded build should now work.

@scott-w Thank you for your efforts with this!

No worries @chill117 - let me know if you find anything else :)