This is a simple build script for bundling RactiveJS components using Gobble and Rollup.
It is designed for quick drop-in replacement for projects that are using traditional web <script>
inclusion of global libraries and have been either putting
Ractive templates inline or via Ractive.load().
All of the dependencies in the package.json
either need to be installed
via npm init
if using the package.json
, or just install via:
> npm install gobble-cli
And then run:
> gobble build -f dist
And gobble will prompt you to install the additional dependencies.
-
Output is controlled via 1) the folder you specify as the last parameter of the
gobble
command (dist
in the example above), and 2) the file name is set on line 42 of thegobblefile.js
. -
It assumes a folder named
components
with single-file ractive components. You can change the folder name on line 25 of thegobblefile.js
.
Include the bundle.js
after Ractive:
<script src='http://cdn.ractivejs.org/latest/ractive.min.js'></script>
<script src='dist/bundle.js'></script>
See index.html
for example of running included components.