0.1.2 • Published 7 years ago

requirejs-transpiler v0.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

requirejs-transpiler

transpile requirejs to ES Module

Compiled Output

An example like this:

  define(
    [
      'jquery'
    ],
    function ($) {
      return {
        init: function () {
          var o = $('#app');
        }
      };
    }
  );

and the output will be:

  import $ from "jquery";
  export default {
    init: function () {
      var o = $('#app');
    }
  };

Usage

Install:

  npm i requirejs-transpiler

API

  const { requirejs-transpiler } = require('requirejs-transpiler')

  requirejs-transpiler({  // options
    srcBasePath,
    srcPattern,
    distBasePath,
    prettier: true
  })

Options

The glob syntax from the glob module is used at srcPattern param.

OptionRequired
srcBasePathtrue
srcPatternfalse
distBasePathfalse
prettierfalse
prettierOptsfalse

Contributing

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago