0.8.14 • Published 9 years ago

autobundler v0.8.14

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

Autobundler

NPM version Dependency Status Build Status Coverage Status Code Climate

The refreshingly easy tool for bundling your ESNext web app

Looking for a starting point with Autobundler? Check out the Autobundler seed project!


[ Installation | Setup | Usage | Configuration | Modules | FAQ ]


Autobundler is still under construction.

See the project milestones for issues to resolve before reaching 1.0.

Feel free to aid development by adding issues and pull requests!


Install with NPM

npm install --save-dev autobundler

Setup

Autobundler requires a directory setup like the following:

src/
  app.js
  app/
    file.js
    subfolder/
      file.js

src/app.js is what Autobundler considers a "top-level file". It's where you import your dependencies and local modules.

From inside src/app.js:

// NPM modules only needed to be imported once, and are available from the global scope.
import 'jquery';
import 'lodash';
import 'angular';

// Make sure the folder containing your
// modules matches the top-level file's name.
// In this example, that would be 'app/'.
import someModule from 'app/file';
import nestedModule from 'app/subfolder/file';

// Do stuff

And from inside src/app/file.js:

// Import neighboring modules and libraries as needed.
// Files imported here aren't bundled by Autobundler,
// so no need to worry about duplication.
import neighborModule from 'app/neighbor';

export default function(){
  // Do stuff
}

When Autobundler runs, it builds a set of files per top-level file:

  • The top-level file, compiled to ES5 with appropriate SystemJS tags
  • A similarly compiled bundle of the top-level file's local modules
  • A bundle of the top-level file's imported dependencies

Those files are then rolled up into a single file, ready for a System.import() into your views.


Usage

See below for configuration options

Inside package.json:

"scripts": {
	"build": "autobundler source=src"
}

Inside index.html:

<!DOCTYPE html>
<html>
<head>
  <title>Your Awesome JavaScript App</title>
  ...
</head>

<body>
  ...
  <script src="system.js"></script>
  <script src="autobundler.config.js"></script>
  <!-- make sure to put your own system.config file after autobundler's -->
  <script src="your.system.config.js"></script>

  <script>
    System.import('path/to/destination/folder/app');
  </script>

</body>
</html>

Open a command prompt, type npm run build, hit enter and relax while Autobundler does the rest.

Yup, that's really all you need!


Configuration Options

In the name of simplicity, Autobundler has a tiny number of configuration object, of which only one is required.

NameDescriptionDefault Values
sourceTop-level directory for your local JavaScript files. Requiredundefined
destinationDirectory where Autobundler will output its generated files.dist
docsWhether Autobundler should generate documentation from JSDoc comments.true
angularSpecifies whether to run angular-specific functions during compilation.false

You can pass these as command line arguments or include them in an "autobundler" field in package.json. (For reference: command line arguments take precendence.)


NPM Modules

Autobundler keeps a database of file locations for a variety of modules, including Angular, React, JQuery, Lodash, and more. Just npm install <module-name>, then import <module-name> into your top-level file.

For the full list, see the docs.

Missing a library? Open an issue or submit a PR!


FAQ

See here for frequently asked questions.


License

MIT © Zack Schuster

0.8.14

9 years ago

0.8.13

9 years ago

0.8.12

9 years ago

0.8.11

9 years ago

0.8.10

9 years ago

0.8.9

9 years ago

0.8.7

9 years ago

0.8.6

9 years ago

0.8.5

9 years ago

0.8.4

9 years ago

0.8.3

9 years ago

0.8.2

9 years ago

0.8.1

9 years ago

0.8.0

9 years ago

0.7.9

9 years ago

0.7.8

9 years ago

0.7.7

9 years ago

0.7.6

9 years ago

0.7.5

9 years ago

0.7.4

9 years ago

0.7.3

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.9

9 years ago

0.6.8

9 years ago

0.6.7

9 years ago

0.6.6

9 years ago

0.6.5

9 years ago

0.6.4

9 years ago

0.6.3

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.9

9 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

10 years ago

0.5.4

10 years ago

0.5.3

10 years ago

0.5.2

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.9

10 years ago

0.4.8

10 years ago

0.4.7

10 years ago

0.4.6

10 years ago

0.4.5

10 years ago

0.4.4

10 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.9

10 years ago

0.3.8

10 years ago

0.3.7

10 years ago

0.3.6

10 years ago

0.3.5

10 years ago

0.3.4

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.10

10 years ago

0.2.9

10 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago