# babel-plugin-app-decorators-style-precompile

> babel plugin for app-decorators style decorator

Latest version **0.8.252** (published 2017-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-app-decorators-style-precompile
pnpm add babel-plugin-app-decorators-style-precompile
yarn add babel-plugin-app-decorators-style-precompile
bun add babel-plugin-app-decorators-style-precompile
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.252 |
| Published | 2017-12-19 |
| First published | 2017-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Serkan Sipahi |
| Maintainers | bitcollage |
| Keywords | parse, syle, decorator |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-app-decorators-style-precompile
- Repository: https://github.com/SerkanSipahi/app-decorators/tree/master/packages/babel-plugin-app-decorators-style-precompile
- Issues: https://github.com/SerkanSipahi/app-decorators/issues
- npm.io page: https://npm.io/package/babel-plugin-app-decorators-style-precompile

## Dependencies (10)

- [should](https://npm.io/package/should.md) 13.1.3
- [core-js](https://npm.io/package/core-js.md) 2.5.2
- [babel-cli](https://npm.io/package/babel-cli.md) 6.26.0
- [assert-diff](https://npm.io/package/assert-diff.md) 1.2.4
- [app-decorators-simple-it](https://npm.io/package/app-decorators-simple-it.md) 0.8.252
- [postcss-parse-atrule-events](https://npm.io/package/postcss-parse-atrule-events.md) 0.8.252
- [babel-plugin-syntax-decorators](https://npm.io/package/babel-plugin-syntax-decorators.md) 6.13.0
- [babel-plugin-syntax-function-bind](https://npm.io/package/babel-plugin-syntax-function-bind.md) 6.13.0
- [babel-plugin-transform-function-bind](https://npm.io/package/babel-plugin-transform-function-bind.md) 6.22.0
- [babel-plugin-transform-es2015-modules-commonjs](https://npm.io/package/babel-plugin-transform-es2015-modules-commonjs.md) 6.26.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.8.252 (latest) — 2017-12-19
- 0.8.251 — 2017-12-10
- 0.8.250 — 2017-10-02
- 0.8.249 — 2017-10-01
- 0.8.248 — 2017-10-01
- 0.8.247 — 2017-10-01
- 0.8.245 — 2017-09-30
- 0.8.244 — 2017-09-21
- 0.8.242 — 2017-08-22
- 0.8.241 — 2017-08-22
- 0.8.240 — 2017-08-16
- 0.8.239 — 2017-08-12
- 0.8.238 — 2017-08-12
- 0.8.237 — 2017-08-10
- 0.8.236 — 2017-08-10
- … 1 more at https://npm.io/package/babel-plugin-app-decorators-style-precompile/versions

## README

## babel-plugin-app-decorators-style-precompile
Babel Plugin for auto generating code

<p>
    <a href="https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-style-precompile"><img src="https://david-dm.org/SerkanSipahi/david.svg" alt="Dependency Status"></a>
    <a href="https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-style-precompile&type=dev"><img src="https://david-dm.org/SerkanSipahi/david/dev-status.svg" alt="devDependency Status"></a>
</p>

### Installation

```sh
$ npm install babel-plugin-app-decorators-style-precompile --save
```

### Usage

#### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["app-decorators-style-precompile"]
}
```

**.babelrc options**
```js
"plugins": [
    ["app-decorators-style-precompile", {
        autoprefixer: "last 2 versions",
        minify: true
    }]
]
```

#### Via CLI

```sh
$ babel --plugins app-decorators-style-precompile script.js
```

#### Via Node API

```js
require('babel').transform('code', {
  plugins: ['app-decorators-style-precompile']
});
```

### The goal of this babel-plugin is precompile precomplie the stylesheet inside of @style:

#### Example
Input:
```js
@view(`
    // this will be loaded async on load event
    @on load {
        @fetch my/async/styles1.css;
        @fetch my/async/styles2.css;
    }
    // this applied immediately
    .my-critical-path-selector {
        width: 100px;
        height: 100px;
    }
`)
class Foo {

}
```
Output:
```js
@view([
    {
        attachOn: "load",
        imports: [
            "my/async/styles1.css",
            "my/async/styles1.css"
        ],
        styles: "",
        type: "on",
    },
    {
        attachOn: "immediately",
        imports: [],
        styles: ".my-critical-path-selector { width: 100px; height: 100px; }",
        type: "default",
    },
])
class Foo {

}
```


#### Tests
```bash
git clone https://github.com/SerkanSipahi/app-decorators.git
cd app-decorators/packages/babel-plugin-app-decorators-style-precompile
make install
make test
```

---
_Source: https://npm.io/package/babel-plugin-app-decorators-style-precompile · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
