初始化代码
This commit is contained in:
324
uniapp/uni-app/node_modules/postcss-loader/CHANGELOG.md
generated
vendored
Normal file
324
uniapp/uni-app/node_modules/postcss-loader/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,324 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/postcss/postcss-loader/compare/v2.1.6...v3.0.0) (2018-08-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** add ast version (`meta.ast`) ([f34954f](https://github.com/postcss/postcss-loader/commit/f34954f))
|
||||
* **index:** emit `warnings` as an instance of `{Error}` ([8ac6fb5](https://github.com/postcss/postcss-loader/commit/8ac6fb5))
|
||||
* **options:** improved `ValidationError` messages ([549ea08](https://github.com/postcss/postcss-loader/commit/549ea08))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** update `postcss` v6.0.0...7.0.0 (`dependencies`) ([#375](https://github.com/postcss/postcss-loader/issues/375)) ([daa0da8](https://github.com/postcss/postcss-loader/commit/daa0da8))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **package:** requires `node >= v6.0.0`
|
||||
|
||||
|
||||
|
||||
<a name="2.1.6"></a>
|
||||
## [2.1.6](https://github.com/postcss/postcss-loader/compare/v2.1.5...v2.1.6) (2018-07-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** config memory leak, updates `postcss-load-config` v1.2.0...2.0.0 (`dependencies`) ([0547b12](https://github.com/postcss/postcss-loader/commit/0547b12))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.5"></a>
|
||||
## [2.1.5](https://github.com/postcss/postcss-loader/compare/v2.1.4...v2.1.5) (2018-05-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** remove `sourceMap` warning ([#361](https://github.com/postcss/postcss-loader/issues/361)) ([4416791](https://github.com/postcss/postcss-loader/commit/4416791))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.4"></a>
|
||||
## [2.1.4](https://github.com/postcss/postcss-loader/compare/v2.1.3...v2.1.4) (2018-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* restore loader object in postcss config context ([#355](https://github.com/postcss/postcss-loader/issues/355)) ([2ff1735](https://github.com/postcss/postcss-loader/commit/2ff1735))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.3"></a>
|
||||
## [2.1.3](https://github.com/postcss/postcss-loader/compare/v2.1.2...v2.1.3) (2018-03-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **options:** revert additionalProperties changes to keep SemVer ([bd7fc38](https://github.com/postcss/postcss-loader/commit/bd7fc38))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.2"></a>
|
||||
## [2.1.2](https://github.com/postcss/postcss-loader/compare/v2.1.1...v2.1.2) (2018-03-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **options:** disallow additional properties and add `ident` to validation ([#346](https://github.com/postcss/postcss-loader/issues/346)) ([82ef553](https://github.com/postcss/postcss-loader/commit/82ef553))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.1"></a>
|
||||
## [2.1.1](https://github.com/postcss/postcss-loader/compare/v2.1.0...v2.1.1) (2018-02-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** don't set `to` value (`options`) ([#339](https://github.com/postcss/postcss-loader/issues/339)) ([cdbb8b6](https://github.com/postcss/postcss-loader/commit/cdbb8b6))
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/postcss/postcss-loader/compare/v2.0.10...v2.1.0) (2018-02-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** continue watching after dependency `{Error}` ([#332](https://github.com/postcss/postcss-loader/issues/332)) ([a8921cc](https://github.com/postcss/postcss-loader/commit/a8921cc))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **index:** pass AST (`result.root`) && Messages (`result.messages`) as metadata to other loaders ([#322](https://github.com/postcss/postcss-loader/issues/322)) ([56232e7](https://github.com/postcss/postcss-loader/commit/56232e7))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.10"></a>
|
||||
## [2.0.10](https://github.com/postcss/postcss-loader/compare/v2.0.9...v2.0.10) (2018-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** copy loader `options` before modifying ([#326](https://github.com/postcss/postcss-loader/issues/326)) ([61ff03c](https://github.com/postcss/postcss-loader/commit/61ff03c))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.9"></a>
|
||||
## [2.0.9](https://github.com/postcss/postcss-loader/compare/v2.0.8...v2.0.9) (2017-11-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** filter `ident` (`options.ident`) ([#315](https://github.com/postcss/postcss-loader/issues/315)) ([3e1c7fa](https://github.com/postcss/postcss-loader/commit/3e1c7fa))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.8"></a>
|
||||
## [2.0.8](https://github.com/postcss/postcss-loader/compare/v2.0.6...v2.0.8) (2017-10-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lib/options:** handle `{Object}` return (`options.plugins`) ([#301](https://github.com/postcss/postcss-loader/issues/301)) ([df010a7](https://github.com/postcss/postcss-loader/commit/df010a7))
|
||||
* **schema:** allow to pass an `{Object}` (`options.syntax/options.stringifier`) ([#300](https://github.com/postcss/postcss-loader/issues/300)) ([58e9996](https://github.com/postcss/postcss-loader/commit/58e9996))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.7"></a>
|
||||
## [2.0.7](https://github.com/postcss/postcss-loader/compare/v2.0.6...v2.0.7) (2017-10-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* sanitizing `from` and `to` options (`postcss.config.js`) ([#260](https://github.com/postcss/postcss-loader/issues/260)) ([753dea7](https://github.com/postcss/postcss-loader/commit/753dea7))
|
||||
* **index:** runaway promise ([#269](https://github.com/postcss/postcss-loader/issues/269)) ([8df20ce](https://github.com/postcss/postcss-loader/commit/8df20ce))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.6"></a>
|
||||
## [2.0.6](https://github.com/postcss/postcss-loader/compare/v2.0.5...v2.0.6) (2017-06-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow to pass an `{Object}` (`options.parser`) ([#257](https://github.com/postcss/postcss-loader/issues/257)) ([4974607](https://github.com/postcss/postcss-loader/commit/4974607))
|
||||
* misspelling in warnings ([#237](https://github.com/postcss/postcss-loader/issues/237)) ([adcbb2e](https://github.com/postcss/postcss-loader/commit/adcbb2e))
|
||||
* **index:** simplify config loading behaviour ([#259](https://github.com/postcss/postcss-loader/issues/259)) ([b313478](https://github.com/postcss/postcss-loader/commit/b313478))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.5"></a>
|
||||
## [2.0.5](https://github.com/postcss/postcss-loader/compare/v2.0.4...v2.0.5) (2017-05-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* regression with `options.plugins` `{Function}` (`webpack.config.js`) (#229) ([dca52a9](https://github.com/postcss/postcss-loader/commit/dca52a9))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.4"></a>
|
||||
## [2.0.4](https://github.com/postcss/postcss-loader/compare/v2.0.3...v2.0.4) (2017-05-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** `postcss.config.js` not resolved correctly (`options.config`) ([faaeee4](https://github.com/postcss/postcss-loader/commit/faaeee4))
|
||||
* **index:** update validation schema, better warning message ([4f20c99](https://github.com/postcss/postcss-loader/commit/4f20c99))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.3"></a>
|
||||
## [2.0.3](https://github.com/postcss/postcss-loader/compare/v2.0.2...v2.0.3) (2017-05-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** don't fail on 'sourceMap: false' && emit a warning instead, when previous map found (`options.sourceMap`) ([159b66a](https://github.com/postcss/postcss-loader/commit/159b66a))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.2"></a>
|
||||
## [2.0.2](https://github.com/postcss/postcss-loader/compare/v2.0.1...v2.0.2) (2017-05-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** 'No PostCSS Config found' (`options.config`) (#215) ([e764761](https://github.com/postcss/postcss-loader/commit/e764761))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/postcss/postcss-loader/compare/v2.0.0...v2.0.1) (2017-05-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **index:** 'Cannot create property `prev` on boolean `false`' (`options.sourceMap`) ([c4f0064](https://github.com/postcss/postcss-loader/commit/c4f0064))
|
||||
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/postcss/postcss-loader/compare/1.2.2...v2.0.0) (2017-05-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **index:** add ctx, ctx.file, ctx.options ([0dceb2c](https://github.com/postcss/postcss-loader/commit/0dceb2c))
|
||||
* **index:** add options validation ([2b76df8](https://github.com/postcss/postcss-loader/commit/2b76df8))
|
||||
|
||||
|
||||
|
||||
## 1.3.3
|
||||
* Remove `postcss-loader-before-processing` warning (by Michael Ciniawsky).
|
||||
|
||||
## 1.3.2
|
||||
* Fix deprecated warning (by Xiaoyu Zhai).
|
||||
|
||||
## 1.3.1
|
||||
* Fix conflict with CLI `--config` argument (by EGOIST).
|
||||
|
||||
## 1.3
|
||||
* Allow object in syntax options, not only path for require (by Jeff Escalante).
|
||||
|
||||
## 1.2.2
|
||||
* Watch `postcss.config.js` for changes (by Michael Ciniawsky).
|
||||
|
||||
## 1.2.1
|
||||
* Fix relative `config` parameter resolving (by Simen Bekkhus).
|
||||
|
||||
## 1.2
|
||||
* Add `config` parameter (by sainthkh).
|
||||
|
||||
## 1.1.1
|
||||
* Fix `this` in options function (by Jeff Escalante).
|
||||
|
||||
## 1.1
|
||||
* PostCSS common config could be placed to subdirs.
|
||||
* Add webpack instance to PostCSS common config context.
|
||||
|
||||
## 1.0
|
||||
* Add common PostCSS config support (by Mateusz Derks).
|
||||
* Add Webpack 2 support with `plugins` query option (by Izaak Schroeder).
|
||||
* Add `dependency` message support.
|
||||
* Rewrite docs (by Michael Ciniawsky).
|
||||
|
||||
## 0.13
|
||||
* Add `exec` parameter (by Neal Granger).
|
||||
|
||||
## 0.12
|
||||
* Add CSS syntax highlight to syntax error code frame.
|
||||
|
||||
## 0.11.1
|
||||
* Fix Promise API (by Daniel Haus).
|
||||
|
||||
## 0.11
|
||||
* Add `postcss-loader-before-processing` webpack event (by Jan Nicklas).
|
||||
|
||||
## 0.10.1
|
||||
* Better syntax error message (by Andrey Popp).
|
||||
|
||||
## 0.10.0
|
||||
* Add `sourceMap` parameter to force inline maps (by 雪狼).
|
||||
|
||||
## 0.9.1
|
||||
* Fix plugin in simple array config.
|
||||
|
||||
## 0.9
|
||||
* Allow to pass syntax, parser or stringifier as function (by Jeff Escalante).
|
||||
|
||||
## 0.8.2
|
||||
* Fix source map support (by Andrew Bradley).
|
||||
|
||||
## 0.8.1
|
||||
* Fix resource path.
|
||||
|
||||
## 0.8
|
||||
* Add postcss-js support (by Simon Degraeve).
|
||||
|
||||
## 0.7
|
||||
* Added argument with webpack instance to plugins callback (by Maxime Thirouin).
|
||||
|
||||
## 0.6
|
||||
* Use PostCSS 5.0.
|
||||
* Remove `safe` parameter. Use Safe Parser.
|
||||
* Add `syntax`, `parser` and `stringifier` parameters.
|
||||
|
||||
## 0.5.1
|
||||
* Fix string source map support (by Jan Nicklas).
|
||||
|
||||
## 0.5.0
|
||||
* Set plugins by function for hot reload support (by Stefano Brilli).
|
||||
|
||||
## 0.4.4
|
||||
* Fix error on empty PostCSS config.
|
||||
|
||||
## 0.4.3
|
||||
* Better check for `CssSyntaxError`.
|
||||
|
||||
## 0.4.2
|
||||
* Fixed invalid sourcemap exception (by Richard Willis).
|
||||
|
||||
## 0.4.1
|
||||
* Use only Promise API to catch PostCSS errors.
|
||||
|
||||
## 0.4
|
||||
* Add PostCSS asynchronous API support.
|
||||
* Fix source map support (by Richard Willis).
|
||||
* Add warnings API support.
|
||||
* Better output for CSS syntax errors.
|
||||
|
||||
## 0.3
|
||||
* Use PostCSS 4.0.
|
||||
|
||||
## 0.2
|
||||
* Use PostCSS 3.0.
|
||||
|
||||
## 0.1
|
||||
* Initial release.
|
||||
20
uniapp/uni-app/node_modules/postcss-loader/LICENSE
generated
vendored
Normal file
20
uniapp/uni-app/node_modules/postcss-loader/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
License (MIT)
|
||||
|
||||
Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
497
uniapp/uni-app/node_modules/postcss-loader/README.md
generated
vendored
Normal file
497
uniapp/uni-app/node_modules/postcss-loader/README.md
generated
vendored
Normal file
@@ -0,0 +1,497 @@
|
||||
[![npm][npm]][npm-url]
|
||||
[![node][node]][node-url]
|
||||
[![deps][deps]][deps-url]
|
||||
[![tests][tests]][tests-url]
|
||||
[![coverage][cover]][cover-url]
|
||||
[![chat][chat]][chat-url]
|
||||
|
||||
<div align="center">
|
||||
<img width="180" height="180" hspace="10"
|
||||
alt="PostCSS Logo"
|
||||
src="https://api.postcss.org/logo.svg">
|
||||
<a href="https://github.com/webpack/webpack">
|
||||
<img width="200" height="200" hspace="10"
|
||||
src="https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg">
|
||||
</a>
|
||||
<div align="center">
|
||||
<a href="https://evilmartians.com/?utm_source=postcss">
|
||||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
||||
alt="Sponsored by Evil Martians" width="236" height="54" vspace="10">
|
||||
</a>
|
||||
</div>
|
||||
<h1>PostCSS Loader</h1>
|
||||
<p>Loader for <a href="https://webpack.js.org/">webpack</a> to process CSS with <a href="https://postcss.org/">PostCSS</a></p>
|
||||
</div>
|
||||
|
||||
<h2 align="center">Install</h2>
|
||||
|
||||
```bash
|
||||
npm i -D postcss-loader
|
||||
```
|
||||
|
||||
<h2 align="center">Usage</h2>
|
||||
|
||||
### `Configuration`
|
||||
|
||||
**`postcss.config.js`**
|
||||
```js
|
||||
module.exports = {
|
||||
parser: 'sugarss',
|
||||
plugins: {
|
||||
'postcss-import': {},
|
||||
'postcss-preset-env': {},
|
||||
'cssnano': {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can read more about common PostCSS Config [here](https://github.com/michael-ciniawsky/postcss-load-config).
|
||||
|
||||
### `Config Cascade`
|
||||
|
||||
You can use different `postcss.config.js` files in different directories.
|
||||
Config lookup starts from `path.dirname(file)` and walks the file tree upwards until a config file is found.
|
||||
|
||||
```
|
||||
|– components
|
||||
| |– component
|
||||
| | |– index.js
|
||||
| | |– index.png
|
||||
| | |– style.css (1)
|
||||
| | |– postcss.config.js (1)
|
||||
| |– component
|
||||
| | |– index.js
|
||||
| | |– image.png
|
||||
| | |– style.css (2)
|
||||
|
|
||||
|– postcss.config.js (1 && 2 (recommended))
|
||||
|– webpack.config.js
|
||||
|
|
||||
|– package.json
|
||||
```
|
||||
|
||||
After setting up your `postcss.config.js`, add `postcss-loader` to your `webpack.config.js`. You can use it standalone or in conjunction with `css-loader` (recommended). Use it **after** `css-loader` and `style-loader`, but **before** other preprocessor loaders like e.g `sass|less|stylus-loader`, if you use any.
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [ 'style-loader', 'postcss-loader' ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> ⚠️ When `postcss-loader` is used standalone (without `css-loader`) don't use `@import` in your CSS, since this can lead to quite bloated bundles
|
||||
|
||||
**`webpack.config.js` (recommended)**
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
'postcss-loader'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<h2 align="center">Options</h2>
|
||||
|
||||
|Name|Type|Default|Description|
|
||||
|:--:|:--:|:-----:|:----------|
|
||||
|[`exec`](#exec)|`{Boolean}`|`undefined`|Enable PostCSS Parser support in `CSS-in-JS`|
|
||||
|[`parser`](#syntaxes)|`{String\|Object}`|`undefined`|Set PostCSS Parser|
|
||||
|[`syntax`](#syntaxes)|`{String\|Object}`|`undefined`|Set PostCSS Syntax|
|
||||
|[`stringifier`](#syntaxes)|`{String\|Object}`|`undefined`|Set PostCSS Stringifier|
|
||||
|[`config`](#config)|`{Object}`|`undefined`|Set `postcss.config.js` config path && `ctx`|
|
||||
|[`plugins`](#plugins)|`{Array\|Function}`|`[]`|Set PostCSS Plugins|
|
||||
|[`sourceMap`](#sourcemap)|`{String\|Boolean}`|`false`|Enable Source Maps|
|
||||
|
||||
### `Exec`
|
||||
|
||||
If you use JS styles without the [`postcss-js`][postcss-js] parser, add the `exec` option.
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.style.js$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
{ loader: 'css-loader', options: { importLoaders: 1 } },
|
||||
{ loader: 'postcss-loader', options: { parser: 'sugarss', exec: true } }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### `Config`
|
||||
|
||||
|Name|Type|Default|Description|
|
||||
|:--:|:--:|:-----:|:----------|
|
||||
|[`path`](#path)|`{String}`|`undefined`|PostCSS Config Directory|
|
||||
|[`context`](#context)|`{Object}`|`undefined`|PostCSS Config Context|
|
||||
|
||||
#### `Path`
|
||||
|
||||
You can manually specify the path to search for your config (`postcss.config.js`) with the `config.path` option. This is needed if you store your config in a separate e.g `./config || ./.config` folder.
|
||||
|
||||
> ⚠️ Otherwise it is **unnecessary** to set this option and is **not** recommended
|
||||
|
||||
> ⚠️ Note that you **can't** use a **filename** other than the [supported config formats] (e.g `.postcssrc.js`, `postcss.config.js`), this option only allows you to manually specify the **directory** where config lookup should **start** from
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
config: {
|
||||
path: 'path/to/.config/' ✅
|
||||
path: 'path/to/.config/css.config.js' ❌
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
[supported config formats]: https://github.com/michael-ciniawsky/postcss-load-config#usage
|
||||
|
||||
#### `Context (ctx)`
|
||||
|
||||
|Name|Type|Default|Description|
|
||||
|:--:|:--:|:-----:|:----------|
|
||||
|`env`|`{String}`|`'development'`|`process.env.NODE_ENV`|
|
||||
|`file`|`{Object}`|`loader.resourcePath`|`extname`, `dirname`, `basename`|
|
||||
|`options`|`{Object}`|`{}`|Options|
|
||||
|
||||
`postcss-loader` exposes context `ctx` to the config file, making your `postcss.config.js` dynamic, so can use it to do some real magic ✨
|
||||
|
||||
**`postcss.config.js`**
|
||||
```js
|
||||
module.exports = ({ file, options, env }) => ({
|
||||
parser: file.extname === '.sss' ? 'sugarss' : false,
|
||||
plugins: {
|
||||
'postcss-import': { root: file.dirname },
|
||||
'postcss-preset-env': options['postcss-preset-env'] ? options['postcss-preset-env'] : false,
|
||||
'cssnano': env === 'production' ? options.cssnano : false
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
config: {
|
||||
ctx: {
|
||||
'postcss-preset-env': {...options},
|
||||
cssnano: {...options},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### `Plugins`
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
ident: 'postcss',
|
||||
plugins: (loader) => [
|
||||
require('postcss-import')({ root: loader.resourcePath }),
|
||||
require('postcss-preset-env')(),
|
||||
require('cssnano')()
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> ⚠️ webpack requires an identifier (`ident`) in `options` when `{Function}/require` is used (Complex Options). The `ident` can be freely named as long as it is unique. It's recommended to name it (`ident: 'postcss'`)
|
||||
|
||||
### `Syntaxes`
|
||||
|
||||
|Name|Type|Default|Description|
|
||||
|:--:|:--:|:-----:|:----------|
|
||||
|[`parser`](#parser)|`{String\|Function}`|`undefined`|Custom PostCSS Parser|
|
||||
|[`syntax`](#syntax)|`{String\|Function}`|`undefined`|Custom PostCSS Syntax|
|
||||
|[`stringifier`](#stringifier)|`{String\|Function}`|`undefined`|Custom PostCSS Stringifier|
|
||||
|
||||
#### `Parser`
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.sss$/,
|
||||
use: [
|
||||
...,
|
||||
{ loader: 'postcss-loader', options: { parser: 'sugarss' } }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### `Syntax`
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
...,
|
||||
{ loader: 'postcss-loader', options: { syntax: 'sugarss' } }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### `Stringifier`
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
...,
|
||||
{ loader: 'postcss-loader', options: { stringifier: 'midas' } }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### `SourceMap`
|
||||
|
||||
Enables source map support, `postcss-loader` will use the previous source map given by other loaders and update it accordingly, if no previous loader is applied before `postcss-loader`, the loader will generate a source map for you.
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.css/,
|
||||
use: [
|
||||
{ loader: 'style-loader', options: { sourceMap: true } },
|
||||
{ loader: 'css-loader', options: { sourceMap: true } },
|
||||
{ loader: 'postcss-loader', options: { sourceMap: true } },
|
||||
{ loader: 'sass-loader', options: { sourceMap: true } }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### `'inline'`
|
||||
|
||||
You can set the `sourceMap: 'inline'` option to inline the source map
|
||||
within the CSS directly as an annotation comment.
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: 'inline'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```css
|
||||
.class { color: red; }
|
||||
|
||||
/*# sourceMappingURL=data:application/json;base64, ... */
|
||||
```
|
||||
|
||||
<h2 align="center">Examples</h2>
|
||||
|
||||
### `Stylelint`
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
'css-loader',
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
ident: 'postcss',
|
||||
plugins: [
|
||||
require('postcss-import')(),
|
||||
require('stylelint')(),
|
||||
...,
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### `Autoprefixing`
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
'css-loader',
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
ident: 'postcss',
|
||||
plugins: [
|
||||
require('autoprefixer')({...options}),
|
||||
...,
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> :warning: [`postcss-preset-env`](https://github.com/csstools/postcss-preset-env) includes [`autoprefixer`](https://github.com/postcss/autoprefixer), so adding it separately is not necessary if you already use the preset.
|
||||
|
||||
### `CSS Modules`
|
||||
|
||||
This loader [cannot be used] with [CSS Modules] out of the box due
|
||||
to the way `css-loader` processes file imports. To make them work properly,
|
||||
either add the css-loader’s [`importLoaders`] option.
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
{ loader: 'css-loader', options: { modules: true, importLoaders: 1 } },
|
||||
'postcss-loader'
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
or use [postcss-modules] instead of `css-loader`.
|
||||
|
||||
[`importLoaders`]: https://github.com/webpack-contrib/css-loader#importloaders
|
||||
[cannot be used]: https://github.com/webpack/css-loader/issues/137
|
||||
[CSS Modules]: https://github.com/webpack/css-loader#css-modules
|
||||
[postcss-modules]: https://github.com/css-modules/postcss-modules
|
||||
|
||||
### `CSS-in-JS`
|
||||
|
||||
If you want to process styles written in JavaScript, use the [postcss-js] parser.
|
||||
|
||||
[postcss-js]: https://github.com/postcss/postcss-js
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
{
|
||||
test: /\.style.js$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
{ loader: 'css-loader', options: { importLoaders: 2 } },
|
||||
{ loader: 'postcss-loader', options: { parser: 'postcss-js' } },
|
||||
'babel-loader'
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
As result you will be able to write styles in the following way
|
||||
|
||||
```js
|
||||
import colors from './styles/colors'
|
||||
|
||||
export default {
|
||||
'.menu': {
|
||||
color: colors.main,
|
||||
height: 25,
|
||||
'&_link': {
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> :warning: If you are using Babel you need to do the following in order for the setup to work
|
||||
|
||||
> 1. Add [babel-plugin-add-module-exports] to your configuration
|
||||
> 2. You need to have only one **default** export per style module
|
||||
|
||||
[babel-plugin-add-module-exports]: https://github.com/59naga/babel-plugin-add-module-exports
|
||||
|
||||
### [Extract CSS][ExtractPlugin]
|
||||
|
||||
[ExtractPlugin]: https://github.com/webpack-contrib/mini-css-extract-plugin
|
||||
|
||||
**`webpack.config.js`**
|
||||
```js
|
||||
const devMode = process.env.NODE_ENV !== 'production'
|
||||
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
|
||||
'css-loader',
|
||||
'postcss-loader'
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: devMode ? '[name].css' : '[name].[hash].css'
|
||||
})
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
<h2 align="center">Maintainers</h2>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/michael-ciniawsky">
|
||||
<img width="150" height="150" src="https://github.com/michael-ciniawsky.png?v=3&s=150">
|
||||
</br>
|
||||
Michael Ciniawsky
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/evilebottnawi">
|
||||
<img width="150" height="150" src="https://github.com/evilebottnawi.png?v=3&s=150">
|
||||
</br>
|
||||
Alexander Krasnoyarov
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/postcss-loader.svg
|
||||
[npm-url]: https://npmjs.com/package/postcss-loader
|
||||
|
||||
[node]: https://img.shields.io/node/v/postcss-loader.svg
|
||||
[node-url]: https://nodejs.org
|
||||
|
||||
[deps]: https://david-dm.org/postcss/postcss-loader.svg
|
||||
[deps-url]: https://david-dm.org/postcss/postcss-loader
|
||||
|
||||
[tests]: https://img.shields.io/travis/postcss/postcss-loader.svg
|
||||
[tests-url]: https://travis-ci.org/postcss/postcss-loader
|
||||
|
||||
[cover]: https://coveralls.io/repos/github/postcss/postcss-loader/badge.svg
|
||||
[cover-url]: https://coveralls.io/github/postcss/postcss-loader
|
||||
|
||||
[chat]: https://badges.gitter.im/postcss/postcss.svg
|
||||
[chat-url]: https://gitter.im/postcss/postcss
|
||||
85
uniapp/uni-app/node_modules/postcss-loader/package.json
generated
vendored
Normal file
85
uniapp/uni-app/node_modules/postcss-loader/package.json
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"postcss-loader@3.0.0",
|
||||
"C:\\Users\\Administrator\\Desktop\\wechat农场"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "postcss-loader@3.0.0",
|
||||
"_id": "postcss-loader@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA==",
|
||||
"_location": "/postcss-loader",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "postcss-loader@3.0.0",
|
||||
"name": "postcss-loader",
|
||||
"escapedName": "postcss-loader",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "C:\\Users\\Administrator\\Desktop\\wechat农场",
|
||||
"author": {
|
||||
"name": "Andrey Sitnik",
|
||||
"email": "andrey@sitnik.ru"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/postcss/postcss-loader/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"loader-utils": "^1.1.0",
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-load-config": "^2.0.0",
|
||||
"schema-utils": "^1.0.0"
|
||||
},
|
||||
"description": "PostCSS loader for webpack",
|
||||
"devDependencies": {
|
||||
"@webpack-utilities/test": "^1.0.0-alpha.0",
|
||||
"jest": "^23.0.0",
|
||||
"jsdoc-to-markdown": "^4.0.0",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-js": "^2.0.0",
|
||||
"standard": "^11.0.0",
|
||||
"standard-version": "^4.0.0",
|
||||
"sugarss": "^1.0.0",
|
||||
"webpack": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"homepage": "https://github.com/postcss/postcss-loader#readme",
|
||||
"keywords": [
|
||||
"css",
|
||||
"postcss",
|
||||
"postcss-runner",
|
||||
"webpack",
|
||||
"webpack-loader"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "src/index.js",
|
||||
"name": "postcss-loader",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/postcss/postcss-loader.git"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -rf coverage test/outputs",
|
||||
"docs": "jsdoc2md src/*.js > docs/LOADER.md",
|
||||
"lint": "standard --env jest",
|
||||
"release": "standard-version",
|
||||
"test": "jest --env node --verbose --coverage"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
}
|
||||
37
uniapp/uni-app/node_modules/postcss-loader/src/Error.js
generated
vendored
Normal file
37
uniapp/uni-app/node_modules/postcss-loader/src/Error.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* **PostCSS Syntax Error**
|
||||
*
|
||||
* Loader wrapper for postcss syntax errors
|
||||
*
|
||||
* @class SyntaxError
|
||||
* @extends Error
|
||||
*
|
||||
* @param {Object} err CssSyntaxError
|
||||
*/
|
||||
class SyntaxError extends Error {
|
||||
constructor (error) {
|
||||
super(error)
|
||||
|
||||
const { line, column, reason } = error
|
||||
|
||||
this.name = 'SyntaxError'
|
||||
|
||||
this.message = `${this.name}\n\n`
|
||||
|
||||
if (typeof line !== 'undefined') {
|
||||
this.message += `(${line}:${column}) `
|
||||
}
|
||||
|
||||
this.message += `${reason}`
|
||||
|
||||
const code = error.showSourceCode()
|
||||
|
||||
if (code) {
|
||||
this.message += `\n\n${code}\n`
|
||||
}
|
||||
|
||||
this.stack = false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SyntaxError
|
||||
31
uniapp/uni-app/node_modules/postcss-loader/src/Warning.js
generated
vendored
Normal file
31
uniapp/uni-app/node_modules/postcss-loader/src/Warning.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* **PostCSS Plugin Warning**
|
||||
*
|
||||
* Loader wrapper for postcss plugin warnings (`root.messages`)
|
||||
*
|
||||
* @class Warning
|
||||
* @extends Error
|
||||
*
|
||||
* @param {Object} warning PostCSS Warning
|
||||
*/
|
||||
class Warning extends Error {
|
||||
constructor (warning) {
|
||||
super(warning)
|
||||
|
||||
const { text, line, column } = warning
|
||||
|
||||
this.name = 'Warning'
|
||||
|
||||
this.message = `${this.name}\n\n`
|
||||
|
||||
if (typeof line !== 'undefined') {
|
||||
this.message += `(${line}:${column}) `
|
||||
}
|
||||
|
||||
this.message += `${text}`
|
||||
|
||||
this.stack = false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Warning
|
||||
232
uniapp/uni-app/node_modules/postcss-loader/src/index.js
generated
vendored
Normal file
232
uniapp/uni-app/node_modules/postcss-loader/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,232 @@
|
||||
const path = require('path')
|
||||
|
||||
const { getOptions } = require('loader-utils')
|
||||
const validateOptions = require('schema-utils')
|
||||
|
||||
const postcss = require('postcss')
|
||||
const postcssrc = require('postcss-load-config')
|
||||
|
||||
const Warning = require('./Warning.js')
|
||||
const SyntaxError = require('./Error.js')
|
||||
const parseOptions = require('./options.js')
|
||||
|
||||
/**
|
||||
* **PostCSS Loader**
|
||||
*
|
||||
* Loads && processes CSS with [PostCSS](https://github.com/postcss/postcss)
|
||||
*
|
||||
* @method loader
|
||||
*
|
||||
* @param {String} css Source
|
||||
* @param {Object} map Source Map
|
||||
*
|
||||
* @return {cb} cb Result
|
||||
*/
|
||||
function loader (css, map, meta) {
|
||||
const options = Object.assign({}, getOptions(this))
|
||||
|
||||
validateOptions(require('./options.json'), options, 'PostCSS Loader')
|
||||
|
||||
const cb = this.async()
|
||||
const file = this.resourcePath
|
||||
|
||||
const sourceMap = options.sourceMap
|
||||
|
||||
Promise.resolve().then(() => {
|
||||
const length = Object.keys(options)
|
||||
.filter((option) => {
|
||||
switch (option) {
|
||||
// case 'exec':
|
||||
case 'ident':
|
||||
case 'config':
|
||||
case 'sourceMap':
|
||||
return
|
||||
default:
|
||||
return option
|
||||
}
|
||||
})
|
||||
.length
|
||||
|
||||
if (length) {
|
||||
return parseOptions.call(this, options)
|
||||
}
|
||||
|
||||
const rc = {
|
||||
path: path.dirname(file),
|
||||
ctx: {
|
||||
file: {
|
||||
extname: path.extname(file),
|
||||
dirname: path.dirname(file),
|
||||
basename: path.basename(file)
|
||||
},
|
||||
options: {}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.config) {
|
||||
if (options.config.path) {
|
||||
rc.path = path.resolve(options.config.path)
|
||||
}
|
||||
|
||||
if (options.config.ctx) {
|
||||
rc.ctx.options = options.config.ctx
|
||||
}
|
||||
}
|
||||
|
||||
rc.ctx.webpack = this
|
||||
|
||||
return postcssrc(rc.ctx, rc.path)
|
||||
}).then((config) => {
|
||||
if (!config) {
|
||||
config = {}
|
||||
}
|
||||
|
||||
if (config.file) {
|
||||
this.addDependency(config.file)
|
||||
}
|
||||
|
||||
// Disable override `to` option from `postcss.config.js`
|
||||
if (config.options.to) {
|
||||
delete config.options.to
|
||||
}
|
||||
// Disable override `from` option from `postcss.config.js`
|
||||
if (config.options.from) {
|
||||
delete config.options.from
|
||||
}
|
||||
|
||||
let plugins = config.plugins || []
|
||||
|
||||
let options = Object.assign({
|
||||
from: file,
|
||||
map: sourceMap
|
||||
? sourceMap === 'inline'
|
||||
? { inline: true, annotation: false }
|
||||
: { inline: false, annotation: false }
|
||||
: false
|
||||
}, config.options)
|
||||
|
||||
// Loader Exec (Deprecated)
|
||||
// https://webpack.js.org/api/loaders/#deprecated-context-properties
|
||||
if (options.parser === 'postcss-js') {
|
||||
css = this.exec(css, this.resource)
|
||||
}
|
||||
|
||||
if (typeof options.parser === 'string') {
|
||||
options.parser = require(options.parser)
|
||||
}
|
||||
|
||||
if (typeof options.syntax === 'string') {
|
||||
options.syntax = require(options.syntax)
|
||||
}
|
||||
|
||||
if (typeof options.stringifier === 'string') {
|
||||
options.stringifier = require(options.stringifier)
|
||||
}
|
||||
|
||||
// Loader API Exec (Deprecated)
|
||||
// https://webpack.js.org/api/loaders/#deprecated-context-properties
|
||||
if (config.exec) {
|
||||
css = this.exec(css, this.resource)
|
||||
}
|
||||
|
||||
if (sourceMap && typeof map === 'string') {
|
||||
map = JSON.parse(map)
|
||||
}
|
||||
|
||||
if (sourceMap && map) {
|
||||
options.map.prev = map
|
||||
}
|
||||
|
||||
return postcss(plugins)
|
||||
.process(css, options)
|
||||
.then((result) => {
|
||||
let { css, map, root, processor, messages } = result
|
||||
|
||||
result.warnings().forEach((warning) => {
|
||||
this.emitWarning(new Warning(warning))
|
||||
})
|
||||
|
||||
messages.forEach((msg) => {
|
||||
if (msg.type === 'dependency') {
|
||||
this.addDependency(msg.file)
|
||||
}
|
||||
})
|
||||
|
||||
map = map ? map.toJSON() : null
|
||||
|
||||
if (map) {
|
||||
map.file = path.resolve(map.file)
|
||||
map.sources = map.sources.map((src) => path.resolve(src))
|
||||
}
|
||||
|
||||
if (!meta) {
|
||||
meta = {}
|
||||
}
|
||||
|
||||
const ast = {
|
||||
type: 'postcss',
|
||||
version: processor.version,
|
||||
root
|
||||
}
|
||||
|
||||
meta.ast = ast
|
||||
meta.messages = messages
|
||||
|
||||
if (this.loaderIndex === 0) {
|
||||
/**
|
||||
* @memberof loader
|
||||
* @callback cb
|
||||
*
|
||||
* @param {Object} null Error
|
||||
* @param {String} css Result (JS Module)
|
||||
* @param {Object} map Source Map
|
||||
*/
|
||||
cb(null, `module.exports = ${JSON.stringify(css)}`, map)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof loader
|
||||
* @callback cb
|
||||
*
|
||||
* @param {Object} null Error
|
||||
* @param {String} css Result (Raw Module)
|
||||
* @param {Object} map Source Map
|
||||
*/
|
||||
cb(null, css, map, meta)
|
||||
|
||||
return null
|
||||
})
|
||||
}).catch((err) => {
|
||||
if (err.file) {
|
||||
this.addDependency(err.file)
|
||||
}
|
||||
|
||||
return err.name === 'CssSyntaxError'
|
||||
? cb(new SyntaxError(err))
|
||||
: cb(err)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Andrey Sitnik (@ai) <andrey@sitnik.ru>
|
||||
*
|
||||
* @license MIT
|
||||
* @version 3.0.0
|
||||
*
|
||||
* @module postcss-loader
|
||||
*
|
||||
* @requires path
|
||||
*
|
||||
* @requires loader-utils
|
||||
* @requires schema-utils
|
||||
*
|
||||
* @requires postcss
|
||||
* @requires postcss-load-config
|
||||
*
|
||||
* @requires ./options.js
|
||||
* @requires ./Warning.js
|
||||
* @requires ./SyntaxError.js
|
||||
*/
|
||||
module.exports = loader
|
||||
36
uniapp/uni-app/node_modules/postcss-loader/src/options.js
generated
vendored
Normal file
36
uniapp/uni-app/node_modules/postcss-loader/src/options.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* **PostCSS Options Parser**
|
||||
*
|
||||
* Transforms the loader options into a valid postcss config `{Object}`
|
||||
*
|
||||
* @method parseOptions
|
||||
*
|
||||
* @param {Boolean} exec Execute CSS-in-JS
|
||||
* @param {String|Object} parser PostCSS Parser
|
||||
* @param {String|Object} syntax PostCSS Syntax
|
||||
* @param {String|Object} stringifier PostCSS Stringifier
|
||||
* @param {Array|Object|Function} plugins PostCSS Plugins
|
||||
*
|
||||
* @return {Promise} PostCSS Config
|
||||
*/
|
||||
function parseOptions ({ exec, parser, syntax, stringifier, plugins }) {
|
||||
if (typeof plugins === 'function') {
|
||||
plugins = plugins.call(this, this)
|
||||
}
|
||||
|
||||
if (typeof plugins === 'undefined') {
|
||||
plugins = []
|
||||
} else if (!Array.isArray(plugins)) {
|
||||
plugins = [ plugins ]
|
||||
}
|
||||
|
||||
const options = {}
|
||||
|
||||
options.parser = parser
|
||||
options.syntax = syntax
|
||||
options.stringifier = stringifier
|
||||
|
||||
return Promise.resolve({ options, plugins, exec })
|
||||
}
|
||||
|
||||
module.exports = parseOptions
|
||||
57
uniapp/uni-app/node_modules/postcss-loader/src/options.json
generated
vendored
Normal file
57
uniapp/uni-app/node_modules/postcss-loader/src/options.json
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"config": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"ctx": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"errorMessage": {
|
||||
"properties": {
|
||||
"ctx": "should be {Object} (https://github.com/postcss/postcss-loader#context-ctx)",
|
||||
"path": "should be {String} (https://github.com/postcss/postcss-loader#path)"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"exec": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"parser": {
|
||||
"type": [ "string", "object" ]
|
||||
},
|
||||
"syntax": {
|
||||
"type": [ "string", "object" ]
|
||||
},
|
||||
"stringifier": {
|
||||
"type": [ "string", "object" ]
|
||||
},
|
||||
"plugins": {
|
||||
"anyOf": [
|
||||
{ "type": "array" },
|
||||
{ "type": "object" },
|
||||
{ "instanceof": "Function" }
|
||||
]
|
||||
},
|
||||
"sourceMap": {
|
||||
"type": [ "string", "boolean" ]
|
||||
}
|
||||
},
|
||||
"errorMessage": {
|
||||
"properties": {
|
||||
"exec": "should be {Boolean} (https://github.com/postcss/postcss-loader#exec)",
|
||||
"config": "should be {Object} (https://github.com/postcss/postcss-loader#config)",
|
||||
"parser": "should be {String|Object} (https://github.com/postcss/postcss-loader#parser)",
|
||||
"syntax": "should be {String|Object} (https://github.com/postcss/postcss-loader#syntax)",
|
||||
"stringifier": "should be {String|Object} (https://github.com/postcss/postcss-loader#stringifier)",
|
||||
"plugins": "should be {Array|Object|Function} (https://github.com/postcss/postcss-loader#plugins)",
|
||||
"sourceMap": "should be {String|Boolean} (https://github.com/postcss/postcss-loader#sourcemap)"
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
Reference in New Issue
Block a user