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

make miss-plete browserify compatible #1

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

dereke
Copy link

@dereke dereke commented Nov 27, 2015

added babel and browserify configuration so that this module can be used by browserify

@xavi
Copy link
Owner

xavi commented Dec 15, 2015

MissPlete is now published to npm, transpiled to ES5 and UMD. Does this make it Browserify compatible too? (See https://github.com/xavi/miss-plete#installation)

@hugomrdias
Copy link

no! why are you loading css in the bundle ?

right now its unusable without setting up full dev env with babel webpack etc etc

@xavi
Copy link
Owner

xavi commented Jan 1, 2016

By loading the CSS in the bundle, the CSS doesn't have to be separately included in the page.

No, there's no need to set up Babel or webpack to use MissPlete, because the bundle is in ES5 and webpack included the code that automatically adds the CSS to the page when the bundle is loaded. For example, do npm install miss-plete --save and now it can be included and used directly in your page with something like

<script src="node_modules/miss-plete/dist/bundle.js"></script>
<script>
  new MissPlete.default({
    input: document.querySelector('input[name="city"]'),
    options: [["Barcelona", "BCN"], ["San Francisco", "SF"]]
  });
</script>

@syropian
Copy link

@xavi It's not working for me with Browserify, the CSS fails to load:

Cannot find module '!!./../node_modules/css-loader/index.js!./miss-plete.css' from '/Users/user/Sites/Homestead/astral/node_modules/miss-plete/dist'

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.

4 participants