Share your code.
rucksackpublic
rucksack
JavaScript and CSS bundler.
☁️ Installation
# Using npm npm install --save rucksack # Using yarn yarn add rucksack
📋 Example
const Rucksack = // Create a new bundlerlet bundler = // Add remote url as resourcebundlerbundlerbundlerbundlerbundlerbundler bundler// => info [Tuesday, November 28, 2017 06:53:48 AM] Bundling the styles.// => warn [Tuesday, November 28, 2017 06:53:48 AM] Skipping remote @import of "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css" as resource is not allowed.// => @import url(https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css);strong{color:#000}strong{color:#ff0}body{background:#fff;-webkit-transform:translate(10px);transform:translate(10px)} bundler// => info [Tuesday, November 28, 2017 06:53:48 AM] Bundling the scripts.// => (function e(t,n,r){...})
❓ Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. 🐛
📝 Documentation
constructor
Ruckasck
Creates a new instance of Ruckasck
.
Params
- Object
opts
: The Rucksack options.
Return
- Object The Rucksack instance.
_watchCSS(resPath)
Watch the CSS paths.
Params
- String
resPath
: The CSS resource path.
addCSS(resPath, inline)
Adds a new CSS path.
Params
- String
resPath
: The CSS resource path to add. - Boolean
inline
: Whether to add the CSS content inline or not.
bundleJS(output, cb)
Bundles the JS files.
Params
- String
output
: The output of the JS script. - Function
cb
: The callback function.
bundleCSS(output, cb)
Bundles the CSS files.
Params
- String
output
: The output of the CSS script. - Function
cb
: The callback function.
Return
- String The URL of the script.
😋 How to contribute
Have an idea? Found a bug? See how to contribute.
💫 Where is this library used?
If you are using this library in one of your projects, add it in this list. ✨
bloggify-cli
(by Bloggify)—We make publishing easy.bloggify-prebuilt
—The prebuilt Bloggify version.