Skip to content

Instantly share code, notes, and snippets.

@FND
Last active May 30, 2020 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FND/d12c7147cbd04812b62c96bbf5ff8c27 to your computer and use it in GitHub Desktop.
Save FND/d12c7147cbd04812b62c96bbf5ff8c27 to your computer and use it in GitHub Desktop.
bundling jQuery plugins with faucet-pipeline
/node_modules
/package-lock.json
/dist
"use strict";
module.exports = {
js: [{
source: "./index.js",
target: "./dist/bundle.js"
}]
};
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bundling jQuery plugins with faucet-pipeline</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: sans-serif;
}
</style>
</head>
<body>
<h1>faucet-pipeline with jQuery</h1>
<script src="dist/bundle.js"></script>
</body>
</html>
import $ from "./jquery_shim";
import "./jqueryui_shim";
import dt from "datatables.net";
let datatables = dt(window, $);
console.log("~~~", $, jQuery.fn.autocomplete, dt, datatables);
import jQuery from "jquery";
export default jQuery;
window.jQuery = jQuery; // global required for jQuery UI
import "jquery-ui/ui/widget";
import * as autocomplete from "jquery-ui/ui/widgets/autocomplete";
export { autocomplete };
{
"scripts": {
"start": "npm run compile -- --watch",
"compile": "faucet"
},
"dependencies": {
"datatables.net": "^1.10.21",
"jquery": "^3.5.1",
"jquery-ui": "^1.12.1"
},
"devDependencies": {
"faucet-pipeline-js": "^2.1.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment