miss-plete icon indicating copy to clipboard operation
miss-plete copied to clipboard

make miss-plete browserify compatible

Open dereke opened this issue 9 years ago • 4 comments

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

dereke avatar Nov 27 '15 16:11 dereke

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)

xavi avatar Dec 15 '15 23:12 xavi

no! why are you loading css in the bundle ?

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

hugomrdias avatar Dec 22 '15 18:12 hugomrdias

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>

xavi avatar Jan 01 '16 18:01 xavi

@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'

syropian avatar Jan 27 '16 01:01 syropian