Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
clay-build-js
Advanced tools
Build JS for your Clay components.
npm install --save clay-build-js
clay build-js
const buildJs = require('clay-build-js');
buildJs({
// defaults
watch: false,
debug: false,
verbose: false
})
public/js
using browserify-splitter. These chunks can be combined arbitrarily by resolve-media within the context of a bundle.client-env.json
, which is an array of all env vars usedfalse
. Watch for changes.false
. Log all files written.false
. Disable bundle-collapser
and uglifyify
, allowing for easier debugging and faster builds.Usually, the JavaScript that any page needs is known beforehand, by the developer. For example, you might include a homepage.js
script on your homepage and a section.js
script on your section pages.
In Clay, a page is made up entirely of arbitrary data -- components. Some components need client-side JavaScript. Any page could theoretically have any combination of components.
So how do we get all the client.js that a page needs on to the page itself? The solution should:
require
should work client-side and ES6 should be transpiled to ES5.Clay-build-js resolves all these issues. It scans your Clay installation for component JS, traces their dependencies, and arranges those dependencies into a bundle via Browserify, but splits that bundle into separate chunks using browserify-splitter. It also extracts a dependency registry with browserify-extract-registry, transpiles to ES5 using Babel, and uglifies.
When Clay generates a page, it detects the components that a page contains, determines which module chunks the components need using the registry clay-build-js exported, and includes only those chunks on the page, nesting them in a context in which require
works. As a result, a Clay server can effectively generate valid bundles on-the-fly without compromising performance.
FAQs
Build JS for your Clay components.
The npm package clay-build-js receives a total of 2 weekly downloads. As such, clay-build-js popularity was classified as not popular.
We found that clay-build-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.