|
1 | | -# ember-m-css-loader |
| 1 | +ember-m-css-loader |
| 2 | +============================================================================== |
2 | 3 |
|
3 | 4 | This [Ember.js](https://emberjs.com/) addon helps load the css file(s) on demand, i.e. lazy loading, inside the `<link>` tag in the `document` `<head>` using the service `m-css-loader` . |
4 | 5 |
|
| 6 | +### Compatibility |
| 7 | +Ember@^3.0.0 |
| 8 | + |
5 | 9 | ### Lazy Loading of CSS |
6 | 10 |
|
7 | 11 | [CSS are render blocking resources.](https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-blocking-css) The ambitious SPAs need more than one CSS resources (external libraries) and some of these CSS resources can be more functionality centric and may not be required to get loaded on the Home screen or may be required only for few of screens. |
@@ -44,25 +48,48 @@ The service `m-css-loader` caches the `href`s loaded to avoid injecting the same |
44 | 48 |
|
45 | 49 | The service inserts a `<link>` tag which as good as having it hardcoded at the time of html load. So no [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) issue. |
46 | 50 |
|
47 | | -## Installation |
| 51 | +Installation |
| 52 | +------------------------------------------------------------------------------ |
| 53 | + |
| 54 | +``` |
| 55 | +ember install ember-m-css-loader |
| 56 | +``` |
| 57 | + |
| 58 | + |
| 59 | +Usage |
| 60 | +------------------------------------------------------------------------------ |
| 61 | + |
| 62 | +[Longer description of how to use the addon in apps.] |
| 63 | + |
48 | 64 |
|
49 | | -* `git clone <repository-url>` this repository |
| 65 | +Contributing |
| 66 | +------------------------------------------------------------------------------ |
| 67 | + |
| 68 | +### Installation |
| 69 | + |
| 70 | +* `git clone <repository-url>` |
50 | 71 | * `cd ember-m-css-loader` |
51 | 72 | * `npm install` |
52 | 73 |
|
53 | | -## Running |
| 74 | +### Linting |
54 | 75 |
|
55 | | -* `ember serve` |
56 | | -* Visit your app at [http://localhost:4200](http://localhost:4200), which loads the [bootstrap](https://getbootstrap.com) CSS lazily. |
| 76 | +* `npm run lint:js` |
| 77 | +* `npm run lint:js -- --fix` |
57 | 78 |
|
58 | | -## Running Tests |
| 79 | +### Running tests |
59 | 80 |
|
60 | | -* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions) |
61 | | -* `ember test` |
62 | | -* `ember test --server` |
| 81 | +* `ember test` – Runs the test suite on the current Ember version |
| 82 | +* `ember test --server` – Runs the test suite in "watch mode" |
| 83 | +* `npm test` – Runs `ember try:each` to test your addon against multiple Ember versions |
63 | 84 |
|
64 | | -## Building |
| 85 | +### Running the dummy application |
65 | 86 |
|
66 | | -* `ember build` |
| 87 | +* `ember serve` |
| 88 | +* Visit the dummy application at [http://localhost:4200](http://localhost:4200). |
67 | 89 |
|
68 | 90 | For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). |
| 91 | + |
| 92 | +License |
| 93 | +------------------------------------------------------------------------------ |
| 94 | + |
| 95 | +This project is licensed under the [MIT License](LICENSE.md). |
0 commit comments