Last active
May 30, 2020 09:10
-
-
Save FND/d12c7147cbd04812b62c96bbf5ff8c27 to your computer and use it in GitHub Desktop.
bundling jQuery plugins with faucet-pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/node_modules | |
/package-lock.json | |
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
module.exports = { | |
js: [{ | |
source: "./index.js", | |
target: "./dist/bundle.js" | |
}] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from "./jquery_shim"; | |
import "./jqueryui_shim"; | |
import dt from "datatables.net"; | |
let datatables = dt(window, $); | |
console.log("~~~", $, jQuery.fn.autocomplete, dt, datatables); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jQuery from "jquery"; | |
export default jQuery; | |
window.jQuery = jQuery; // global required for jQuery UI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "jquery-ui/ui/widget"; | |
import * as autocomplete from "jquery-ui/ui/widgets/autocomplete"; | |
export { autocomplete }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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