Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-inline-content

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-inline-content

An add-on for ember-cli that allows you to render inline scripts and styles directly into your index.html file.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by11.93%
Maintainers
1
Weekly downloads
 
Created
Source

ember-cli-inline-content

An add-on for ember-cli that allows you to render inline scripts and styles directly into your index.html file.

Example

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

Why?

  • You want some code to execute before your whole app downloads
  • You want some code not to be bundled with your app and excute without a separate request
  • <script async> is not widely supported, or incompatible with some code
  • Some 3rd party scripts recommend, or require to inline their code

TODO

ES6 module support

Keywords

FAQs

Package last updated on 07 Oct 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc