
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
ember-cli-inline-content
Advanced tools
An ember-cli add-on to render inline scripts and styles directly into your index.html file
An ember-cli add-on to render inline scripts and styles directly into your index.html file.
npm install --save-dev ember-cli-inline-content
In your app's Brocfile.js, define a manifest of files you want to inline (name : filepath)
var app = new EmberApp({
...
inlineContent: {
'google-analytics' : 'ext/google-analytics.js',
'fast-style' : 'ext/red.css'
}
});
In your index.html file, use the 'content-for' helper with a reference to the name in the manifest
{{content-for 'fast-style'}}
<p>some other stuff</p>
{{content-for 'google-analytics'}}
During the build preocess, this will render the contents of those files directly inline with <script>
or <style>
tags, based on the filetype. In production, the contents of the inline blocks will be minified (will obey minifyJS, minifyCSS options in Brocfile).
The above example will output in index.html:
<style>
body {
color: red;
}
</style>
<p>some other stuff</p>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('send', 'pageview');
</script>
var app = new EmberApp({
...
inlineContent: {
'olark' : {
file: 'ext/olark.js',
attrs: { 'data-cfasync' : 'true' }
}
}
});
Will output:
<script data-cfasync="true">
...ext/olark.js content here...
</script>
var app = new EmberApp({
...
});
if (app.env === 'production') {
app.options.inlineContent = {
'some-script' : 'ext/some-script.js'
};
}
<script async>
is not widely supported, or incompatible with some 3rd party codeFAQs
An ember-cli add-on to render inline scripts, styles, or any content directly into your index.html file
The npm package ember-cli-inline-content receives a total of 0 weekly downloads. As such, ember-cli-inline-content popularity was classified as not popular.
We found that ember-cli-inline-content 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.