Giter Club home page Giter Club logo

ember-wrap's Introduction

Note: don't use this, read this StackOverflow answer instead.

ember-wrap

Note: this isn't an Ember addon, it's a shell script. ๐Ÿ˜›

ember-wrap is a shell script that transforms node modules into standalone JavaScript files. It is a workaround for some of ember-browserify's shortcomings, namely trouble with transpiling ES6 syntax and poor compatibility with addons. Once the standalone JS files are generated, you can move them to vendor/ and import them in your ember-cli-build.js as usual.

Install

$ npm install -g ember-wrap

Example

Let's try installing git-data, which is a module that uses ES6.

Within an Ember project:

$ npm install git-data
$ wrap git-data
$ ls vendor/ # now has git-data.js and git-data-shim.js

Add the following to your ember-cli-build.js:

app.import('vendor/git-data.js')
app.import('vendor/git-data-shim.js')

And import the module freely in your Ember project:

import GitData from 'git-data'
window['git-data'] // => undefined

If necessary, you can run wrap in npm's postinstall hook. This is useful if you want to keep a dependency up-to-date.

// place this in package.json
{
  "scripts": {
    "postinstall": "wrap git-data"
  }
}

Docs


  Usage: wrap [options] <module>

  Options:

    -o, --outdir <dirname>    [default: vendor/]

      Output directory.

  Examples:

    Note that the modules below use ES6 features.

    $ npm install git-data
    $ wrap git-data

    $ npm install joi
    $ wrap joi

    $ wrap --outdir somedir/ joi

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.