Skip to content

Commit

Permalink
Merge branch 'release/v1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
andreashuber69 committed Feb 4, 2020
2 parents fc3c06a + 68f4011 commit 4593e6a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 34 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ branches:
script:
- npm run ci

notifications:
email:
recipients:
- secure: rcvNa2MQIV1Hu0/PFQ9ZFrUggJC/i7/CKm2FvXhsgmZwEJXs4gasiOo6UDN6jp18zR/53IguHev0KlsudLrJ6g9/KvjQnEnf+eo9ZnvyAE4cAYoropjRVbtz02XzMDo8JFoTBvQkxwrASTUwSDXJVsFhjkvBraj18Oi5aJkijD5NUuc1F35OboG/S0hhsHFF2QZWmSvQQrgvRs9ADABbpyZZlUw4m224auK48/p4X17ETxthCzkpDJulaizYBO+UygjbCVtd1YP6q1QqgKvOrDcfNPG5hXps7oCz5Fcj1TqnYWXqfhos5vYJJcULJveA7DS3aQk0PG5RylZwtra3xibjJ6uRJjgBkXwgCSNJLVnqphFZFE5Xznt95x2KY/1kCTv5Bbl7vxj+JTeKXMQ+SILutQmad/8nGYMqrxkvIB6OHJwvnfwoEp7kDr5SC37IOdT8MnVz4RcQd0bPQoR1XIsETHWUxPFC1hFkVGHGcQxjs6FnMa5YOQUyPwwUQfe9VjdTpdrEEEzgEosJXOGNiof07bODHGK2yA41fa1p1SrmebemZysV8OWEr3HKqZB0Uq23gn41VHef4ICslPWeYS+dOrG72yXGPwvRX8D+r3tOrtYXefrS2flz0zf95yLcZ/u2i80YddzDk53/zMtY1vS5SwUPVLZe/3FNpAvuPtY=

deploy:
provider: npm
skip_cleanup: true
email:
secure: "E0WqQq0SE2PzhNSy+LsmmIytZsaT6N2dlZETNsD67x+LKx9WtUqMofgpfPK0B1/9w4u15i5nL01shG6A2HbPOwDNQY8eD5lhr/pmlPleN4S1yJHvFBaRhvm1zXNpLLs/sewelPDBy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QQrgvRs9ADABbpyZZlUw4m224auK48/p4X17ETxthCzkpDJulaizYBO+UygjbCVtd1YP6q1QqgKvOrDcfNPG5hXps7oCz5Fcj1TqnYWXqfhos5vYJJcULJveA7DS3aQk0PG5RylZwtra3xibjJ6uRJjgBkXwgCSNJLVnqphFZFE5Xznt95x2KY/1kCTv5Bbl7vxj+JTeKXMQ+SILutQmad/8nGYMqrxkvIB6OHJwvnfwoEp7kDr5SC37IOdT8MnVz4RcQd0bPQoR1XIsETHWUxPFC1hFkVGHGcQxjs6FnMa5YOQUyPwwUQfe9VjdTpdrEEEzgEosJXOGNiof07bODHGK2yA41fa1p1SrmebemZysV8OWEr3HKqZB0Uq23gn41VHef4ICslPWeYS+dOrG72yXGPwvRX8D+r3tOrtYXefrS2flz0zf95yLcZ/u2i80YddzDk53/zMtY1vS5SwUPVLZe/3FNpAvuPtY=
28 changes: 10 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ much better perceived responsiveness of your site.
This plugin is designed for applications that are built using **[webpack](https://webpack.js.org/)**. More specifically,
your application must satisfy **one** of the following conditions:

- Your application is built using **webpack** directly or a framework that allows for the existence of
*[webpack.config.js](https://webpack.js.org/configuration/)*.
- Your application is built using **webpack** directly or a framework that allows for the configuration of **webpack**
with *[webpack.config.js](https://webpack.js.org/configuration/)*.
- Your application is built using a framework like **[Vue](https://vuejs.org)** that "abstracts away"
*webpack.config.js* but provides
[access to the configuration](https://cli.vuejs.org/guide/webpack.html#chaining-advanced).
*webpack.config.js* but provides a [different way](https://cli.vuejs.org/guide/webpack.html#chaining-advanced) to
modify the **webpack** configuration.

## Getting Started

Expand All @@ -67,7 +67,7 @@ your application must satisfy **one** of the following conditions:
`AsyncCssPlugin` configuration depends on how your project is set up, please see [Prerequisites](#Prerequisites) for
more information.

#### `webpack.config.js`
#### webpack.config.js

If your project does not yet contain *[webpack.config.js](https://webpack.js.org/configuration/)*, please create one in
the same folder as *package.json*. Otherwise, please modify accordingly. `AsyncCssPlugin` depends on
Expand All @@ -86,7 +86,7 @@ module.exports = {
};
```

#### `vue.config.js`
#### vue.config.js

If your Vue project does not yet contain *[vue.config.js](https://cli.vuejs.org/config/)*, please create one in the same
folder as *package.json*. Otherwise, please adapt accordingly:
Expand Down Expand Up @@ -118,21 +118,13 @@ For details on why and how this works, please see
**filament group**.

As mentioned above, async CSS loading only makes sense when the CSS being loaded **does not** affect the currently
visible page. It is your responsibility to show a different page while this happens, check out
**[Net Worth](https://andreashuber69.github.io/net-worth)** for an example.
visible page. It is your responsibility to show a different page (e.g. a loading indicator) while this happens, check
out **[Net Worth](https://andreashuber69.github.io/net-worth)** for an example.

## Options

The `AsyncCssPlugin` constructor accepts an (optional) options object, which looks as follows:

``` ts
type MessageType = "info" | "warn" | "error";

interface Options {
// "info" logs everything, "warn" logs warnings and errors, "error" logs errors only. Default is "warn".
readonly logLevel?: MessageType;
}
```
The `AsyncCssPlugin` constructor accepts an (optional)
[Options](https://github.com/andreashuber69/async-css-plugin/blob/develop/src/Options.ts) object.

## Credits

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"description": "Minimal webpack plugin that transforms links to css files such that they are loaded asynchronously.",
"homepage": "https://github.com/andreashuber69/async-css-plugin/blob/master/README.md#--",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
9 changes: 2 additions & 7 deletions src/AsyncCssPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import { Hooks } from "html-webpack-plugin";
import { Compiler } from "webpack";

import { MessageType, Options } from "./Options";

interface UntypedHooks {
[key: string]: unknown;
}

type Page = Parameters<Parameters<Hooks["htmlWebpackPluginAlterAssetTags"]["tap"]>[1]>[0];
type HtmlTagObject = Page["head"][0];

export type MessageType = "info" | "warn" | "error";

export interface Options {
/** "info" logs everything, "warn" logs warnings and errors, "error" logs errors only. Default is "warn". */
readonly logLevel?: MessageType;
}

// tslint:disable-next-line: no-default-export
export default class AsyncCssPlugin {
public constructor(options: Options = {}) {
Expand Down
6 changes: 6 additions & 0 deletions src/Options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type MessageType = "info" | "warn" | "error";

export interface Options {
/** "info" logs everything, "warn" logs warnings and errors, "error" logs errors only. Default is "warn". */
readonly logLevel?: MessageType;
}

0 comments on commit 4593e6a

Please sign in to comment.