bower-requirejs-auto

WebJar for bower-requirejs-auto

License

License

MIT
Categories

Categories

JavaScript Languages Auto Application Layer Libs Code Generators
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

bower-requirejs-auto
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

bower-requirejs-auto
WebJar for bower-requirejs-auto
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/adjohnson916/bower-requirejs-auto

Download bower-requirejs-auto

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/bower-requirejs-auto/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>bower-requirejs-auto</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/bower-requirejs-auto/
implementation 'org.webjars.bower:bower-requirejs-auto:0.1.0'
// https://jarcasting.com/artifacts/org.webjars.bower/bower-requirejs-auto/
implementation ("org.webjars.bower:bower-requirejs-auto:0.1.0")
'org.webjars.bower:bower-requirejs-auto:jar:0.1.0'
<dependency org="org.webjars.bower" name="bower-requirejs-auto" rev="0.1.0">
  <artifact name="bower-requirejs-auto" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='bower-requirejs-auto', version='0.1.0')
)
libraryDependencies += "org.webjars.bower" % "bower-requirejs-auto" % "0.1.0"
[org.webjars.bower/bower-requirejs-auto "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : requirejs jar [2.1.15,2.2)

Project Modules

There are no modules declared in this project.

bower-requirejs-auto

Automatically configures RequireJS paths for Bower components in the browser at runtime. Just get started as fast as possible with Bower and RequireJS!

Recommended for development use only.

Simpler than hard-coding all your Bower component paths into HTML, and faster than tools like yeoman/bower-requirejs (or yeoman/grunt-bower-requirejs) which require their own configuration and repeated execution.

Install

bower install --save-dev bower-requirejs-auto

Use

Add bower-requirejs-auto/index.js to your page, and specify options via the following attributes on its <script> tag:

  • data-then: (required) a main module to load after automatic configuration is complete, like RequireJS's data-main.
  • data-base: (optional, default: '' ) a relative path to your "base" directory containing bower.json and bower_components.
  • data-bower-path: (optional, default: 'bower_components') the path of your bower_components directory, relative to your "base" directory.

See example. In summary:

<!-- index.html -->
<script src="bower_components/requirejs/require.js"></script>
<script src="bower_components/bower-requirejs-auto/index.js" data-then="main"></script>
// main.js
require([ /* ... */ ], function ( /* ... */ ) {
  // ...
});

Versions

Version
0.1.0
0.0.2