Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 2.33 KB

ember-cli.md

File metadata and controls

42 lines (27 loc) · 2.33 KB

Ember CLI

As for Ember, read the Ember CLI guide 2 or 3 times. Every time you'll spot something that you didn't fully understand the previous time.

Development

Load resources from different servers

Sometimes you need to poll an external API, or load a script from a third-party CDN.

Ember CLI comes bundled with the ember-cli-content-security-policy addon which enables the Content Security Policy in modern browsers when running the development server.

Here is an example of configuration you can add to your environment/config.js file:

module.exports = function(environment) {
    var ENV = {
        ...

        contentSecurityPolicy: {
            'default-src': "'none'",
            'script-src': "'self' https://cdn.mxpnl.com", // Allow scripts from https://cdn.mxpnl.com
            'font-src': "'self' http://fonts.gstatic.com", // Allow fonts to be loaded from http://fonts.gstatic.com
            'connect-src': "'self' https://api.mixpanel.com http://custom-api.local", // Allow data (ajax/websocket) from api.mixpanel.com and custom-api.local
            'img-src': "'self'",
            'style-src': "'self' 'unsafe-inline' http://fonts.googleapis.com", // Allow inline styles and loaded CSS from http://fonts.googleapis.com 
            'media-src': "'self'"
        }
    };

More information at ember-cli-content-security-policy repository.

Windows

Ember CLI can make your Windows machine a little bit busy while building and watching files. To improve performance of ember build and ember serve commands you can use the tool ember-cli-windows on Github (by Microsoft).

Alternatively, you can manually disable the tmp folder of your project repository from both Windows Defender and Windows Search Index.

I personally exluded the whole project repository folder from both Windows tools, since I don't really take advantage of neither one.