aboutsummaryrefslogtreecommitdiff
path: root/node_modules/css-loader
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/css-loader
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
Diffstat (limited to 'node_modules/css-loader')
-rw-r--r--node_modules/css-loader/CHANGELOG.md163
-rw-r--r--node_modules/css-loader/LICENSE20
-rw-r--r--node_modules/css-loader/README.md564
-rw-r--r--node_modules/css-loader/index.js5
-rw-r--r--node_modules/css-loader/lib/compile-exports.js51
-rw-r--r--node_modules/css-loader/lib/createResolver.js36
-rw-r--r--node_modules/css-loader/lib/css-base.js76
-rw-r--r--node_modules/css-loader/lib/getImportPrefix.js14
-rw-r--r--node_modules/css-loader/lib/getLocalIdent.js23
-rw-r--r--node_modules/css-loader/lib/loader.js146
-rw-r--r--node_modules/css-loader/lib/localsLoader.js49
-rw-r--r--node_modules/css-loader/lib/processCss.js264
-rw-r--r--node_modules/css-loader/lib/url/escape.js16
-rw-r--r--node_modules/css-loader/locals.js5
-rw-r--r--node_modules/css-loader/package.json51
15 files changed, 1483 insertions, 0 deletions
diff --git a/node_modules/css-loader/CHANGELOG.md b/node_modules/css-loader/CHANGELOG.md
new file mode 100644
index 00000000..c29017fc
--- /dev/null
+++ b/node_modules/css-loader/CHANGELOG.md
@@ -0,0 +1,163 @@
+# 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="0.28.11"></a>
+## [0.28.11](https://github.com/webpack-contrib/css-loader/compare/v0.28.10...v0.28.11) (2018-03-16)
+
+
+### Bug Fixes
+
+* **lib/processCss:** don't check `mode` for `url` handling (`options.modules`) ([#698](https://github.com/webpack-contrib/css-loader/issues/698)) ([c788450](https://github.com/webpack-contrib/css-loader/commit/c788450))
+
+
+
+<a name="0.28.10"></a>
+## [0.28.10](https://github.com/webpack-contrib/css-loader/compare/v0.28.9...v0.28.10) (2018-02-22)
+
+
+### Bug Fixes
+
+* **getLocalIdent:** add `rootContext` support (`webpack >= v4.0.0`) ([#681](https://github.com/webpack-contrib/css-loader/issues/681)) ([9f876d2](https://github.com/webpack-contrib/css-loader/commit/9f876d2))
+
+
+
+<a name="0.28.9"></a>
+## [0.28.9](https://github.com/webpack-contrib/css-loader/compare/v0.28.8...v0.28.9) (2018-01-17)
+
+
+### Bug Fixes
+
+* ignore invalid URLs (`url()`) ([#663](https://github.com/webpack-contrib/css-loader/issues/663)) ([d1d8221](https://github.com/webpack-contrib/css-loader/commit/d1d8221))
+
+
+
+<a name="0.28.8"></a>
+## [0.28.8](https://github.com/webpack-contrib/css-loader/compare/v0.28.7...v0.28.8) (2018-01-05)
+
+
+### Bug Fixes
+
+* **loader:** correctly check if source map is `undefined` ([#641](https://github.com/webpack-contrib/css-loader/issues/641)) ([0dccfa9](https://github.com/webpack-contrib/css-loader/commit/0dccfa9))
+* proper URL escaping and wrapping (`url()`) ([#627](https://github.com/webpack-contrib/css-loader/issues/627)) ([8897d44](https://github.com/webpack-contrib/css-loader/commit/8897d44))
+
+
+
+<a name="0.28.7"></a>
+## [0.28.7](https://github.com/webpack/css-loader/compare/v0.28.6...v0.28.7) (2017-08-30)
+
+
+### Bug Fixes
+
+* pass resolver to `localsLoader` (`options.alias`) ([#601](https://github.com/webpack/css-loader/issues/601)) ([8f1b57c](https://github.com/webpack/css-loader/commit/8f1b57c))
+
+
+
+<a name="0.28.6"></a>
+## [0.28.6](https://github.com/webpack/css-loader/compare/v0.28.5...v0.28.6) (2017-08-30)
+
+
+### Bug Fixes
+
+* add support for aliases starting with `/` (`options.alias`) ([#597](https://github.com/webpack/css-loader/issues/597)) ([63567f2](https://github.com/webpack/css-loader/commit/63567f2))
+
+
+
+<a name="0.28.5"></a>
+## [0.28.5](https://github.com/webpack/css-loader/compare/v0.28.4...v0.28.5) (2017-08-17)
+
+
+### Bug Fixes
+
+* match mutliple dashes (`options.camelCase`) ([#556](https://github.com/webpack/css-loader/issues/556)) ([1fee601](https://github.com/webpack/css-loader/commit/1fee601))
+* stricter `[@import](https://github.com/import)` tolerance ([#593](https://github.com/webpack/css-loader/issues/593)) ([2e4ec09](https://github.com/webpack/css-loader/commit/2e4ec09))
+
+
+
+<a name="0.28.4"></a>
+## [0.28.4](https://github.com/webpack/css-loader/compare/v0.28.3...v0.28.4) (2017-05-30)
+
+
+### Bug Fixes
+
+* preserve leading underscore in class names ([#543](https://github.com/webpack/css-loader/issues/543)) ([f6673c8](https://github.com/webpack/css-loader/commit/f6673c8))
+
+
+
+<a name="0.28.3"></a>
+## [0.28.3](https://github.com/webpack/css-loader/compare/v0.28.2...v0.28.3) (2017-05-25)
+
+
+### Bug Fixes
+
+* correct plugin order for CSS Modules ([#534](https://github.com/webpack/css-loader/issues/534)) ([b90f492](https://github.com/webpack/css-loader/commit/b90f492))
+
+
+
+<a name="0.28.2"></a>
+## [0.28.2](https://github.com/webpack/css-loader/compare/v0.28.1...v0.28.2) (2017-05-22)
+
+
+### Bug Fixes
+
+* source maps path on `windows` ([#532](https://github.com/webpack/css-loader/issues/532)) ([c3d0d91](https://github.com/webpack/css-loader/commit/c3d0d91))
+
+
+
+<a name="0.28.1"></a>
+## [0.28.1](https://github.com/webpack/css-loader/compare/v0.28.0...v0.28.1) (2017-05-02)
+
+
+### Bug Fixes
+
+* allow to specify a full hostname as a root URL ([#521](https://github.com/webpack/css-loader/issues/521)) ([06d27a1](https://github.com/webpack/css-loader/commit/06d27a1))
+* case insensitivity of [@import](https://github.com/import) ([#514](https://github.com/webpack/css-loader/issues/514)) ([de4356b](https://github.com/webpack/css-loader/commit/de4356b))
+* don't handle empty [@import](https://github.com/import) and url() ([#513](https://github.com/webpack/css-loader/issues/513)) ([868fc94](https://github.com/webpack/css-loader/commit/868fc94))
+* imported variables are replaced in exports if followed by a comma ([#504](https://github.com/webpack/css-loader/issues/504)) ([956bad7](https://github.com/webpack/css-loader/commit/956bad7))
+* loader now correctly handles `url` with space(s) ([#495](https://github.com/webpack/css-loader/issues/495)) ([534ea55](https://github.com/webpack/css-loader/commit/534ea55))
+* url with a trailing space is now handled correctly ([#494](https://github.com/webpack/css-loader/issues/494)) ([e1ec4f2](https://github.com/webpack/css-loader/commit/e1ec4f2))
+* use `btoa` instead `Buffer` ([#501](https://github.com/webpack/css-loader/issues/501)) ([fbb0714](https://github.com/webpack/css-loader/commit/fbb0714))
+
+
+### Performance Improvements
+
+* generate source maps only when explicitly set ([#478](https://github.com/webpack/css-loader/issues/478)) ([b8f5c8f](https://github.com/webpack/css-loader/commit/b8f5c8f))
+
+
+
+<a name="0.28.0"></a>
+# [0.28.0](https://github.com/webpack/css-loader/compare/v0.27.3...v0.28.0) (2017-03-30)
+
+
+### Features
+
+* add alias feature to rewrite URLs ([#274](https://github.com/webpack/css-loader/issues/274)) ([c8db489](https://github.com/webpack/css-loader/commit/c8db489))
+
+
+
+<a name="0.27.3"></a>
+## [0.27.3](https://github.com/webpack/css-loader/compare/v0.27.2...v0.27.3) (2017-03-13)
+
+
+
+<a name="0.27.2"></a>
+# [0.27.2](https://github.com/webpack/css-loader/compare/v0.27.1...v0.27.2) (2017-03-12)
+
+<a name="0.27.1"></a>
+# [0.27.1](https://github.com/webpack/css-loader/compare/v0.27.0...v0.27.1) (2017-03-10)
+
+<a name="0.27.0"></a>
+# [0.27.0](https://github.com/webpack/css-loader/compare/v0.26.2...v0.27.0) (2017-03-10)
+
+
+### Bug Fixes
+
+* **sourcemaps:** use abs paths & remove sourceRoot ([c769ac3](https://github.com/webpack/css-loader/commit/c769ac3))
+* `minimizeOptions` should be `query.minimize`! ([16c0858](https://github.com/webpack/css-loader/commit/16c0858))
+* do not export duplicate keys ([#420](https://github.com/webpack/css-loader/issues/420)) ([a2b85d7](https://github.com/webpack/css-loader/commit/a2b85d7))
+
+
+### Features
+
+* allow removal of original class name ([#445](https://github.com/webpack/css-loader/issues/445)) ([3f78361](https://github.com/webpack/css-loader/commit/3f78361))
+* Include the sourceMappingURL & sourceURL when toString() ([6da7e90](https://github.com/webpack/css-loader/commit/6da7e90))
diff --git a/node_modules/css-loader/LICENSE b/node_modules/css-loader/LICENSE
new file mode 100644
index 00000000..8c11fc72
--- /dev/null
+++ b/node_modules/css-loader/LICENSE
@@ -0,0 +1,20 @@
+Copyright JS Foundation and other contributors
+
+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.
diff --git a/node_modules/css-loader/README.md b/node_modules/css-loader/README.md
new file mode 100644
index 00000000..ad10100e
--- /dev/null
+++ b/node_modules/css-loader/README.md
@@ -0,0 +1,564 @@
+[![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" vspace="20"
+ src="https://cdn.worldvectorlogo.com/logos/css-3.svg">
+ <a href="https://github.com/webpack/webpack">
+ <img width="200" height="200"
+ src="https://webpack.js.org/assets/icon-square-big.svg">
+ </a>
+ <h1>CSS Loader</h1>
+</div>
+
+<h2 align="center">Install</h2>
+
+```bash
+npm install --save-dev css-loader
+```
+
+<h2 align="center">Usage</h2>
+
+The `css-loader` interprets `@import` and `url()` like `import/require()`
+and will resolve them.
+
+Good loaders for requiring your assets are the [file-loader](https://github.com/webpack/file-loader)
+and the [url-loader](https://github.com/webpack/url-loader) which you should specify in your config (see [below](https://github.com/webpack-contrib/css-loader#assets)).
+
+**file.js**
+```js
+import css from 'file.css';
+```
+
+**webpack.config.js**
+```js
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: [ 'style-loader', 'css-loader' ]
+ }
+ ]
+ }
+}
+```
+
+### `toString`
+
+You can also use the css-loader results directly as string, such as in Angular's component style.
+
+**webpack.config.js**
+```js
+{
+   test: /\.css$/,
+   use: [
+     'to-string-loader',
+ 'css-loader'
+   ]
+}
+```
+
+or
+
+```js
+const css = require('./test.css').toString();
+
+console.log(css); // {String}
+```
+
+If there are SourceMaps, they will also be included in the result string.
+
+If, for one reason or another, you need to extract CSS as a
+plain string resource (i.e. not wrapped in a JS module) you
+might want to check out the [extract-loader](https://github.com/peerigon/extract-loader).
+It's useful when you, for instance, need to post process the CSS as a string.
+
+**webpack.config.js**
+```js
+{
+   test: /\.css$/,
+   use: [
+ 'handlebars-loader', // handlebars loader expects raw resource string
+     'extract-loader',
+ 'css-loader'
+   ]
+}
+```
+
+<h2 align="center">Options</h2>
+
+|Name|Type|Default|Description|
+|:--:|:--:|:-----:|:----------|
+|**[`root`](#root)**|`{String}`|`/`|Path to resolve URLs, URLs starting with `/` will not be translated|
+|**[`url`](#url)**|`{Boolean}`|`true`| Enable/Disable `url()` handling|
+|**[`alias`](#alias)**|`{Object}`|`{}`|Create aliases to import certain modules more easily|
+|**[`import`](#import)** |`{Boolean}`|`true`| Enable/Disable @import handling|
+|**[`modules`](#modules)**|`{Boolean}`|`false`|Enable/Disable CSS Modules|
+|**[`minimize`](#minimize)**|`{Boolean\|Object}`|`false`|Enable/Disable minification|
+|**[`sourceMap`](#sourcemap)**|`{Boolean}`|`false`|Enable/Disable Sourcemaps|
+|**[`camelCase`](#camelcase)**|`{Boolean\|String}`|`false`|Export Classnames in CamelCase|
+|**[`importLoaders`](#importloaders)**|`{Number}`|`0`|Number of loaders applied before CSS loader|
+|**`localIdentName`**|`{String}`|`[hash:base64]`|Configure the generated ident|
+
+### `root`
+
+For URLs that start with a `/`, the default behavior is to not translate them.
+
+`url(/image.png) => url(/image.png)`
+
+If a `root` query parameter is set, however, it will be prepended to the URL
+and then translated.
+
+**webpack.config.js**
+```js
+{
+ loader: 'css-loader',
+ options: { root: '.' }
+}
+```
+
+`url(/image.png)` => `require('./image.png')`
+
+Using 'Root-relative' urls is not recommended. You should only use it for legacy CSS files.
+
+### `url`
+
+To disable `url()` resolving by `css-loader` set the option to `false`.
+
+To be compatible with existing css files (if not in CSS Module mode).
+
+```
+url(image.png) => require('./image.png')
+url(~module/image.png) => require('module/image.png')
+```
+
+### `alias`
+
+Rewrite your urls with alias, this is useful when it's hard to change url paths of your input files, for example, when you're using some css / sass files in another package (bootstrap, ratchet, font-awesome, etc.).
+
+`css-loader`'s `alias` follows the same syntax as webpack's `resolve.alias`, you can see the details at the [resolve docs](https://webpack.js.org/configuration/resolve/#resolve-alias)
+
+**file.scss**
+```css
+@charset "UTF-8";
+@import "bootstrap";
+```
+
+**webpack.config.js**
+```js
+{
+ test: /\.scss$/,
+ use: [
+ {
+ loader: "style-loader"
+ },
+ {
+ loader: "css-loader",
+ options: {
+ alias: {
+ "../fonts/bootstrap": "bootstrap-sass/assets/fonts/bootstrap"
+ }
+ }
+ },
+ {
+ loader: "sass-loader",
+ options: {
+ includePaths: [
+ path.resolve("./node_modules/bootstrap-sass/assets/stylesheets")
+ ]
+ }
+ }
+ ]
+}
+```
+
+Check out this [working bootstrap example](https://github.com/bbtfr/webpack2-bootstrap-sass-sample).
+
+### `import`
+
+To disable `@import` resolving by `css-loader` set the option to `false`
+
+```css
+@import url('https://fonts.googleapis.com/css?family=Roboto');
+```
+
+> _⚠️ Use with caution, since this disables resolving for **all** `@import`s, including css modules `composes: xxx from 'path/to/file.css'` feature._
+
+### [`modules`](https://github.com/css-modules/css-modules)
+
+The query parameter `modules` enables the **CSS Modules** spec.
+
+This enables local scoped CSS by default. (You can switch it off with `:global(...)` or `:global` for selectors and/or rules.).
+
+#### `Scope`
+
+By default CSS exports all classnames into a global selector scope. Styles can be locally scoped to avoid globally scoping styles.
+
+The syntax `:local(.className)` can be used to declare `className` in the local scope. The local identifiers are exported by the module.
+
+With `:local` (without brackets) local mode can be switched on for this selector. `:global(.className)` can be used to declare an explicit global selector. With `:global` (without brackets) global mode can be switched on for this selector.
+
+The loader replaces local selectors with unique identifiers. The choosen unique identifiers are exported by the module.
+
+```css
+:local(.className) { background: red; }
+:local .className { color: green; }
+:local(.className .subClass) { color: green; }
+:local .className .subClass :global(.global-class-name) { color: blue; }
+```
+
+```css
+._23_aKvs-b8bW2Vg3fwHozO { background: red; }
+._23_aKvs-b8bW2Vg3fwHozO { color: green; }
+._23_aKvs-b8bW2Vg3fwHozO ._13LGdX8RMStbBE9w-t0gZ1 { color: green; }
+._23_aKvs-b8bW2Vg3fwHozO ._13LGdX8RMStbBE9w-t0gZ1 .global-class-name { color: blue; }
+```
+
+> :information_source: Identifiers are exported
+
+```js
+exports.locals = {
+ className: '_23_aKvs-b8bW2Vg3fwHozO',
+ subClass: '_13LGdX8RMStbBE9w-t0gZ1'
+}
+```
+
+CamelCase is recommended for local selectors. They are easier to use in the within the imported JS module.
+
+`url()` URLs in block scoped (`:local .abc`) rules behave like requests in modules.
+
+```
+file.png => ./file.png
+~module/file.png => module/file.png
+```
+
+You can use `:local(#someId)`, but this is not recommended. Use classes instead of ids.
+You can configure the generated ident with the `localIdentName` query parameter (default `[hash:base64]`).
+
+ **webpack.config.js**
+ ```js
+{
+ test: /\.css$/,
+ use: [
+ {
+ loader: 'css-loader',
+ options: {
+ modules: true,
+ localIdentName: '[path][name]__[local]--[hash:base64:5]'
+ }
+ }
+ ]
+}
+```
+
+You can also specify the absolute path to your custom `getLocalIdent` function to generate classname based on a different schema. This requires `webpack >= 2.2.1` (it supports functions in the `options` object).
+
+**webpack.config.js**
+```js
+{
+ loader: 'css-loader',
+ options: {
+ modules: true,
+ localIdentName: '[path][name]__[local]--[hash:base64:5]',
+ getLocalIdent: (context, localIdentName, localName, options) => {
+ return 'whatever_random_class_name'
+ }
+ }
+}
+```
+
+> :information_source: For prerendering with extract-text-webpack-plugin you should use `css-loader/locals` instead of `style-loader!css-loader` **in the prerendering bundle**. It doesn't embed CSS but only exports the identifier mappings.
+
+#### `Composing`
+
+When declaring a local classname you can compose a local class from another local classname.
+
+```css
+:local(.className) {
+ background: red;
+ color: yellow;
+}
+
+:local(.subClass) {
+ composes: className;
+ background: blue;
+}
+```
+
+This doesn't result in any change to the CSS itself but exports multiple classnames.
+
+```js
+exports.locals = {
+ className: '_23_aKvs-b8bW2Vg3fwHozO',
+ subClass: '_13LGdX8RMStbBE9w-t0gZ1 _23_aKvs-b8bW2Vg3fwHozO'
+}
+```
+
+``` css
+._23_aKvs-b8bW2Vg3fwHozO {
+ background: red;
+ color: yellow;
+}
+
+._13LGdX8RMStbBE9w-t0gZ1 {
+ background: blue;
+}
+```
+
+#### `Importing`
+
+To import a local classname from another module.
+
+```css
+:local(.continueButton) {
+ composes: button from 'library/button.css';
+ background: red;
+}
+```
+
+```css
+:local(.nameEdit) {
+ composes: edit highlight from './edit.css';
+ background: red;
+}
+```
+
+To import from multiple modules use multiple `composes:` rules.
+
+```css
+:local(.className) {
+ composes: edit hightlight from './edit.css';
+ composes: button from 'module/button.css';
+ composes: classFromThisModule;
+ background: red;
+}
+```
+
+### `minimize`
+
+By default the css-loader minimizes the css if specified by the module system.
+
+In some cases the minification is destructive to the css, so you can provide your own options to the cssnano-based minifier if needed. See [cssnano's documentation](http://cssnano.co/guides/) for more information on the available options.
+
+You can also disable or enforce minification with the `minimize` query parameter.
+
+**webpack.config.js**
+```js
+{
+ loader: 'css-loader',
+ options: {
+ minimize: true || {/* CSSNano Options */}
+ }
+}
+```
+
+### `sourceMap`
+
+To include source maps set the `sourceMap` option.
+
+I. e. the extract-text-webpack-plugin can handle them.
+
+They are not enabled by default because they expose a runtime overhead and increase in bundle size (JS source maps do not). In addition to that relative paths are buggy and you need to use an absolute public path which include the server URL.
+
+**webpack.config.js**
+```js
+{
+ loader: 'css-loader',
+ options: {
+ sourceMap: true
+ }
+}
+```
+
+### `camelCase`
+
+By default, the exported JSON keys mirror the class names. If you want to camelize class names (useful in JS), pass the query parameter `camelCase` to css-loader.
+
+|Name|Type|Description|
+|:--:|:--:|:----------|
+|**`true`**|`{Boolean}`|Class names will be camelized|
+|**`'dashes'`**|`{String}`|Only dashes in class names will be camelized|
+|**`'only'`** |`{String}`|Introduced in `0.27.1`. Class names will be camelized, the original class name will be removed from the locals|
+|**`'dashesOnly'`**|`{String}`|Introduced in `0.27.1`. Dashes in class names will be camelized, the original class name will be removed from the locals|
+
+**file.css**
+```css
+.class-name {}
+```
+
+**file.js**
+```js
+import { className } from 'file.css';
+```
+
+**webpack.config.js**
+```js
+{
+ loader: 'css-loader',
+ options: {
+ camelCase: true
+ }
+}
+```
+
+### `importLoaders`
+
+The query parameter `importLoaders` allows to configure how many loaders before `css-loader` should be applied to `@import`ed resources.
+
+**webpack.config.js**
+```js
+{
+ test: /\.css$/,
+ use: [
+ 'style-loader',
+ {
+ loader: 'css-loader',
+ options: {
+ importLoaders: 2 // 0 => no loaders (default); 1 => postcss-loader; 2 => postcss-loader, sass-loader
+ }
+ },
+ 'postcss-loader',
+ 'sass-loader'
+ ]
+}
+```
+
+This may change in the future, when the module system (i. e. webpack) supports loader matching by origin.
+
+<h2 align="center">Examples</h2>
+
+### Assets
+
+The following `webpack.config.js` can load CSS files, embed small PNG/JPG/GIF/SVG images as well as fonts as [Data URLs](https://tools.ietf.org/html/rfc2397) and copy larger files to the output directory.
+
+**webpack.config.js**
+```js
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: [ 'style-loader', 'css-loader' ]
+ },
+ {
+ test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
+ loader: 'url-loader',
+ options: {
+ limit: 10000
+ }
+ }
+ ]
+ }
+}
+```
+
+### Extract
+
+For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on. This can be achieved by using the [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) to extract the CSS when running in production mode.
+
+**webpack.config.js**
+```js
+const env = process.env.NODE_ENV
+
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
+
+module.exports = {
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: env === 'production'
+ ? ExtractTextPlugin.extract({
+ fallback: 'style-loader',
+ use: [ 'css-loader' ]
+ })
+ : [ 'style-loader', 'css-loader' ]
+ },
+ ]
+ },
+ plugins: env === 'production'
+ ? [
+ new ExtractTextPlugin({
+ filename: '[name].css'
+ })
+ ]
+ : []
+}
+```
+
+<h2 align="center">Maintainers</h2>
+
+<table>
+ <tbody>
+ <tr>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/bebraw.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/bebraw">Juho Vepsäläinen</a>
+ </td>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/d3viant0ne.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/d3viant0ne">Joshua Wiens</a>
+ </td>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/SpaceK33z.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/SpaceK33z">Kees Kluskens</a>
+ </td>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/TheLarkInn.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/TheLarkInn">Sean Larkin</a>
+ </td>
+ </tr>
+ <tr>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/michael-ciniawsky.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/michael-ciniawsky">Michael Ciniawsky</a>
+ </td>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/evilebottnawi.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/evilebottnawi">Evilebot Tnawi</a>
+ </td>
+ <td align="center">
+ <img width="150" height="150"
+ src="https://github.com/joscha.png?v=3&s=150">
+ </br>
+ <a href="https://github.com/joscha">Joscha Feth</a>
+ </td>
+ </tr>
+ <tbody>
+</table>
+
+
+[npm]: https://img.shields.io/npm/v/css-loader.svg
+[npm-url]: https://npmjs.com/package/css-loader
+
+[node]: https://img.shields.io/node/v/css-loader.svg
+[node-url]: https://nodejs.org
+
+[deps]: https://david-dm.org/webpack-contrib/css-loader.svg
+[deps-url]: https://david-dm.org/webpack-contrib/css-loader
+
+[tests]: http://img.shields.io/travis/webpack-contrib/css-loader.svg
+[tests-url]: https://travis-ci.org/webpack-contrib/css-loader
+
+[cover]: https://codecov.io/gh/webpack-contrib/css-loader/branch/master/graph/badge.svg
+[cover-url]: https://codecov.io/gh/webpack-contrib/css-loader
+
+[chat]: https://badges.gitter.im/webpack/webpack.svg
+[chat-url]: https://gitter.im/webpack/webpack
diff --git a/node_modules/css-loader/index.js b/node_modules/css-loader/index.js
new file mode 100644
index 00000000..cef663dc
--- /dev/null
+++ b/node_modules/css-loader/index.js
@@ -0,0 +1,5 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+module.exports = require("./lib/loader");
diff --git a/node_modules/css-loader/lib/compile-exports.js b/node_modules/css-loader/lib/compile-exports.js
new file mode 100644
index 00000000..8e14087d
--- /dev/null
+++ b/node_modules/css-loader/lib/compile-exports.js
@@ -0,0 +1,51 @@
+var camelCase = require("lodash.camelcase");
+
+function dashesCamelCase(str) {
+ return str.replace(/-+(\w)/g, function(match, firstLetter) {
+ return firstLetter.toUpperCase();
+ });
+}
+
+module.exports = function compileExports(result, importItemMatcher, camelCaseKeys) {
+ if (!Object.keys(result.exports).length) {
+ return "";
+ }
+
+ var exportJs = Object.keys(result.exports).reduce(function(res, key) {
+ var valueAsString = JSON.stringify(result.exports[key]);
+ valueAsString = valueAsString.replace(result.importItemRegExpG, importItemMatcher);
+ function addEntry(k) {
+ res.push("\t" + JSON.stringify(k) + ": " + valueAsString);
+ }
+
+ var targetKey;
+ switch(camelCaseKeys) {
+ case true:
+ addEntry(key);
+ targetKey = camelCase(key);
+ if (targetKey !== key) {
+ addEntry(targetKey);
+ }
+ break;
+ case 'dashes':
+ addEntry(key);
+ targetKey = dashesCamelCase(key);
+ if (targetKey !== key) {
+ addEntry(targetKey);
+ }
+ break;
+ case 'only':
+ addEntry(camelCase(key));
+ break;
+ case 'dashesOnly':
+ addEntry(dashesCamelCase(key));
+ break;
+ default:
+ addEntry(key);
+ break;
+ }
+ return res;
+ }, []).join(",\n");
+
+ return "{\n" + exportJs + "\n}";
+};
diff --git a/node_modules/css-loader/lib/createResolver.js b/node_modules/css-loader/lib/createResolver.js
new file mode 100644
index 00000000..c0d89701
--- /dev/null
+++ b/node_modules/css-loader/lib/createResolver.js
@@ -0,0 +1,36 @@
+module.exports = function createResolver(alias) {
+ if(typeof alias !== "object" || Array.isArray(alias)) {
+ return function(url) {
+ return url
+ };
+ }
+
+ alias = Object.keys(alias).map(function(key) {
+ var onlyModule = false;
+ var obj = alias[key];
+ if(/\$$/.test(key)) {
+ onlyModule = true;
+ key = key.substr(0, key.length - 1);
+ }
+ if(typeof obj === "string") {
+ obj = {
+ alias: obj
+ };
+ }
+ obj = Object.assign({
+ name: key,
+ onlyModule: onlyModule
+ }, obj);
+ return obj;
+ });
+
+ return function(url) {
+ alias.forEach(function(obj) {
+ var name = obj.name;
+ if(url === name || (!obj.onlyModule && url.startsWith(name + "/"))) {
+ url = obj.alias + url.substr(name.length);
+ }
+ });
+ return url;
+ }
+}
diff --git a/node_modules/css-loader/lib/css-base.js b/node_modules/css-loader/lib/css-base.js
new file mode 100644
index 00000000..59af87df
--- /dev/null
+++ b/node_modules/css-loader/lib/css-base.js
@@ -0,0 +1,76 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+// css base code, injected by the css-loader
+module.exports = function(useSourceMap) {
+ var list = [];
+
+ // return the list of modules as css string
+ list.toString = function toString() {
+ return this.map(function (item) {
+ var content = cssWithMappingToString(item, useSourceMap);
+ if(item[2]) {
+ return "@media " + item[2] + "{" + content + "}";
+ } else {
+ return content;
+ }
+ }).join("");
+ };
+
+ // import a list of modules into the list
+ list.i = function(modules, mediaQuery) {
+ if(typeof modules === "string")
+ modules = [[null, modules, ""]];
+ var alreadyImportedModules = {};
+ for(var i = 0; i < this.length; i++) {
+ var id = this[i][0];
+ if(typeof id === "number")
+ alreadyImportedModules[id] = true;
+ }
+ for(i = 0; i < modules.length; i++) {
+ var item = modules[i];
+ // skip already imported module
+ // this implementation is not 100% perfect for weird media query combinations
+ // when a module is imported multiple times with different media queries.
+ // I hope this will never occur (Hey this way we have smaller bundles)
+ if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
+ if(mediaQuery && !item[2]) {
+ item[2] = mediaQuery;
+ } else if(mediaQuery) {
+ item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
+ }
+ list.push(item);
+ }
+ }
+ };
+ return list;
+};
+
+function cssWithMappingToString(item, useSourceMap) {
+ var content = item[1] || '';
+ var cssMapping = item[3];
+ if (!cssMapping) {
+ return content;
+ }
+
+ if (useSourceMap && typeof btoa === 'function') {
+ var sourceMapping = toComment(cssMapping);
+ var sourceURLs = cssMapping.sources.map(function (source) {
+ return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
+ });
+
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
+ }
+
+ return [content].join('\n');
+}
+
+// Adapted from convert-source-map (MIT)
+function toComment(sourceMap) {
+ // eslint-disable-next-line no-undef
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
+ var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
+
+ return '/*# ' + data + ' */';
+}
diff --git a/node_modules/css-loader/lib/getImportPrefix.js b/node_modules/css-loader/lib/getImportPrefix.js
new file mode 100644
index 00000000..5d3be772
--- /dev/null
+++ b/node_modules/css-loader/lib/getImportPrefix.js
@@ -0,0 +1,14 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+module.exports = function getImportPrefix(loaderContext, query) {
+ if(query.importLoaders === false)
+ return "";
+ var importLoaders = parseInt(query.importLoaders, 10) || 0;
+ var loadersRequest = loaderContext.loaders.slice(
+ loaderContext.loaderIndex,
+ loaderContext.loaderIndex + 1 + importLoaders
+ ).map(function(x) { return x.request; }).join("!");
+ return "-!" + loadersRequest + "!";
+};
diff --git a/node_modules/css-loader/lib/getLocalIdent.js b/node_modules/css-loader/lib/getLocalIdent.js
new file mode 100644
index 00000000..79c7ab57
--- /dev/null
+++ b/node_modules/css-loader/lib/getLocalIdent.js
@@ -0,0 +1,23 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+var loaderUtils = require("loader-utils");
+var path = require("path");
+
+module.exports = function getLocalIdent(loaderContext, localIdentName, localName, options) {
+ if(!options.context) {
+ if (loaderContext.rootContext) {
+ options.context = loaderContext.rootContext;
+ } else if (loaderContext.options && typeof loaderContext.options.context === "string") {
+ options.context = loaderContext.options.context;
+ } else {
+ options.context = loaderContext.context;
+ }
+ }
+ var request = path.relative(options.context, loaderContext.resourcePath);
+ options.content = options.hashPrefix + request + "+" + localName;
+ localIdentName = localIdentName.replace(/\[local\]/gi, localName);
+ var hash = loaderUtils.interpolateName(loaderContext, localIdentName, options);
+ return hash.replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-").replace(/^((-?[0-9])|--)/, "_$1");
+};
diff --git a/node_modules/css-loader/lib/loader.js b/node_modules/css-loader/lib/loader.js
new file mode 100644
index 00000000..3d5033f6
--- /dev/null
+++ b/node_modules/css-loader/lib/loader.js
@@ -0,0 +1,146 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+var loaderUtils = require("loader-utils");
+var processCss = require("./processCss");
+var getImportPrefix = require("./getImportPrefix");
+var compileExports = require("./compile-exports");
+var createResolver = require("./createResolver");
+
+
+module.exports = function(content, map) {
+ if(this.cacheable) this.cacheable();
+ var callback = this.async();
+ var query = loaderUtils.getOptions(this) || {};
+ var root = query.root;
+ var moduleMode = query.modules || query.module;
+ var camelCaseKeys = query.camelCase || query.camelcase;
+ var sourceMap = query.sourceMap || false;
+ var resolve = createResolver(query.alias);
+
+ if(sourceMap) {
+ if (map) {
+ if (typeof map === "string") {
+ map = JSON.stringify(map);
+ }
+
+ if (map.sources) {
+ map.sources = map.sources.map(function (source) {
+ return source.replace(/\\/g, '/');
+ });
+ map.sourceRoot = '';
+ }
+ }
+ } else {
+ // Some loaders (example `"postcss-loader": "1.x.x"`) always generates source map, we should remove it
+ map = null;
+ }
+
+ processCss(content, map, {
+ mode: moduleMode ? "local" : "global",
+ from: loaderUtils.getRemainingRequest(this).split("!").pop(),
+ to: loaderUtils.getCurrentRequest(this).split("!").pop(),
+ query: query,
+ resolve: resolve,
+ minimize: this.minimize,
+ loaderContext: this,
+ sourceMap: sourceMap
+ }, function(err, result) {
+ if(err) return callback(err);
+
+ var cssAsString = JSON.stringify(result.source);
+
+ // for importing CSS
+ var importUrlPrefix = getImportPrefix(this, query);
+
+ var alreadyImported = {};
+ var importJs = result.importItems.filter(function(imp) {
+ if(!imp.mediaQuery) {
+ if(alreadyImported[imp.url])
+ return false;
+ alreadyImported[imp.url] = true;
+ }
+ return true;
+ }).map(function(imp) {
+ if(!loaderUtils.isUrlRequest(imp.url, root)) {
+ return "exports.push([module.id, " +
+ JSON.stringify("@import url(" + imp.url + ");") + ", " +
+ JSON.stringify(imp.mediaQuery) + "]);";
+ } else {
+ var importUrl = importUrlPrefix + imp.url;
+ return "exports.i(require(" + loaderUtils.stringifyRequest(this, importUrl) + "), " + JSON.stringify(imp.mediaQuery) + ");";
+ }
+ }, this).join("\n");
+
+ function importItemMatcher(item) {
+ var match = result.importItemRegExp.exec(item);
+ var idx = +match[1];
+ var importItem = result.importItems[idx];
+ var importUrl = importUrlPrefix + importItem.url;
+ return "\" + require(" + loaderUtils.stringifyRequest(this, importUrl) + ").locals" +
+ "[" + JSON.stringify(importItem.export) + "] + \"";
+ }
+
+ cssAsString = cssAsString.replace(result.importItemRegExpG, importItemMatcher.bind(this));
+
+ // helper for ensuring valid CSS strings from requires
+ var urlEscapeHelper = "";
+
+ if(query.url !== false && result.urlItems.length > 0) {
+ urlEscapeHelper = "var escape = require(" + loaderUtils.stringifyRequest(this, require.resolve("./url/escape.js")) + ");\n";
+
+ cssAsString = cssAsString.replace(result.urlItemRegExpG, function(item) {
+ var match = result.urlItemRegExp.exec(item);
+ var idx = +match[1];
+ var urlItem = result.urlItems[idx];
+ var url = resolve(urlItem.url);
+ idx = url.indexOf("?#");
+ if(idx < 0) idx = url.indexOf("#");
+ var urlRequest;
+ if(idx > 0) { // idx === 0 is catched by isUrlRequest
+ // in cases like url('webfont.eot?#iefix')
+ urlRequest = url.substr(0, idx);
+ return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")) + \"" +
+ url.substr(idx);
+ }
+ urlRequest = url;
+ return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")) + \"";
+ }.bind(this));
+ }
+
+ var exportJs = compileExports(result, importItemMatcher.bind(this), camelCaseKeys);
+ if (exportJs) {
+ exportJs = "exports.locals = " + exportJs + ";";
+ }
+
+ var moduleJs;
+ if(sourceMap && result.map) {
+ // add a SourceMap
+ map = result.map;
+ if(map.sources) {
+ map.sources = map.sources.map(function(source) {
+ return source.split("!").pop().replace(/\\/g, '/');
+ }, this);
+ map.sourceRoot = "";
+ }
+ map.file = map.file.split("!").pop().replace(/\\/g, '/');
+ map = JSON.stringify(map);
+ moduleJs = "exports.push([module.id, " + cssAsString + ", \"\", " + map + "]);";
+ } else {
+ moduleJs = "exports.push([module.id, " + cssAsString + ", \"\"]);";
+ }
+
+ // embed runtime
+ callback(null, urlEscapeHelper +
+ "exports = module.exports = require(" +
+ loaderUtils.stringifyRequest(this, require.resolve("./css-base.js")) +
+ ")(" + sourceMap + ");\n" +
+ "// imports\n" +
+ importJs + "\n\n" +
+ "// module\n" +
+ moduleJs + "\n\n" +
+ "// exports\n" +
+ exportJs);
+ }.bind(this));
+};
diff --git a/node_modules/css-loader/lib/localsLoader.js b/node_modules/css-loader/lib/localsLoader.js
new file mode 100644
index 00000000..73d5757a
--- /dev/null
+++ b/node_modules/css-loader/lib/localsLoader.js
@@ -0,0 +1,49 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+var loaderUtils = require("loader-utils");
+var processCss = require("./processCss");
+var getImportPrefix = require("./getImportPrefix");
+var compileExports = require("./compile-exports");
+var createResolver = require("./createResolver");
+
+
+module.exports = function(content) {
+ if(this.cacheable) this.cacheable();
+ var callback = this.async();
+ var query = loaderUtils.getOptions(this) || {};
+ var moduleMode = query.modules || query.module;
+ var camelCaseKeys = query.camelCase || query.camelcase;
+ var resolve = createResolver(query.alias);
+
+ processCss(content, null, {
+ mode: moduleMode ? "local" : "global",
+ query: query,
+ minimize: this.minimize,
+ loaderContext: this,
+ resolve: resolve
+ }, function(err, result) {
+ if(err) return callback(err);
+
+ // for importing CSS
+ var importUrlPrefix = getImportPrefix(this, query);
+
+ function importItemMatcher(item) {
+ var match = result.importItemRegExp.exec(item);
+ var idx = +match[1];
+ var importItem = result.importItems[idx];
+ var importUrl = importUrlPrefix + importItem.url;
+ return "\" + require(" + loaderUtils.stringifyRequest(this, importUrl) + ")" +
+ "[" + JSON.stringify(importItem.export) + "] + \"";
+ }
+
+ var exportJs = compileExports(result, importItemMatcher.bind(this), camelCaseKeys);
+ if (exportJs) {
+ exportJs = "module.exports = " + exportJs + ";";
+ }
+
+
+ callback(null, exportJs);
+ }.bind(this));
+};
diff --git a/node_modules/css-loader/lib/processCss.js b/node_modules/css-loader/lib/processCss.js
new file mode 100644
index 00000000..ac65af16
--- /dev/null
+++ b/node_modules/css-loader/lib/processCss.js
@@ -0,0 +1,264 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+var formatCodeFrame = require("babel-code-frame");
+var Tokenizer = require("css-selector-tokenizer");
+var postcss = require("postcss");
+var loaderUtils = require("loader-utils");
+var assign = require("object-assign");
+var getLocalIdent = require("./getLocalIdent");
+
+var icssUtils = require('icss-utils');
+var localByDefault = require("postcss-modules-local-by-default");
+var extractImports = require("postcss-modules-extract-imports");
+var modulesScope = require("postcss-modules-scope");
+var modulesValues = require("postcss-modules-values");
+var valueParser = require('postcss-value-parser');
+
+var parserPlugin = postcss.plugin("css-loader-parser", function(options) {
+ return function(css) {
+ var imports = {};
+ var exports = {};
+ var importItems = [];
+ var urlItems = [];
+
+ function replaceImportsInString(str) {
+ if(options.import) {
+ var tokens = valueParser(str);
+ tokens.walk(function (node) {
+ if (node.type !== 'word') {
+ return;
+ }
+ var token = node.value;
+ var importIndex = imports["$" + token];
+ if(typeof importIndex === "number") {
+ node.value = "___CSS_LOADER_IMPORT___" + importIndex + "___";
+ }
+ })
+ return tokens.toString();
+ }
+ return str;
+ }
+
+ if(options.import) {
+ css.walkAtRules(/^import$/i, function(rule) {
+ var values = Tokenizer.parseValues(rule.params);
+ var url = values.nodes[0].nodes[0];
+ if(url && url.type === "url") {
+ url = url.url;
+ } else if(url && url.type === "string") {
+ url = url.value;
+ } else throw rule.error("Unexpected format " + rule.params);
+ if (!url.replace(/\s/g, '').length) {
+ return;
+ }
+ values.nodes[0].nodes.shift();
+ var mediaQuery = Tokenizer.stringifyValues(values);
+
+ if(loaderUtils.isUrlRequest(url, options.root)) {
+ url = loaderUtils.urlToRequest(url, options.root);
+ }
+
+ importItems.push({
+ url: url,
+ mediaQuery: mediaQuery
+ });
+ rule.remove();
+ });
+ }
+
+ var icss = icssUtils.extractICSS(css);
+ exports = icss.icssExports;
+ Object.keys(icss.icssImports).forEach(function(key) {
+ var url = loaderUtils.parseString(key);
+ Object.keys(icss.icssImports[key]).forEach(function(prop) {
+ imports["$" + prop] = importItems.length;
+ importItems.push({
+ url: url,
+ export: icss.icssImports[key][prop]
+ });
+ })
+ });
+
+ Object.keys(exports).forEach(function(exportName) {
+ exports[exportName] = replaceImportsInString(exports[exportName]);
+ });
+
+ function isAlias(url) {
+ // Handle alias starting by / and root disabled
+ return url !== options.resolve(url)
+ }
+
+ function processNode(item) {
+ switch (item.type) {
+ case "value":
+ item.nodes.forEach(processNode);
+ break;
+ case "nested-item":
+ item.nodes.forEach(processNode);
+ break;
+ case "item":
+ var importIndex = imports["$" + item.name];
+ if (typeof importIndex === "number") {
+ item.name = "___CSS_LOADER_IMPORT___" + importIndex + "___";
+ }
+ break;
+ case "url":
+ if (options.url && item.url.replace(/\s/g, '').length && !/^#/.test(item.url) && (isAlias(item.url) || loaderUtils.isUrlRequest(item.url, options.root))) {
+ // Strip quotes, they will be re-added if the module needs them
+ item.stringType = "";
+ delete item.innerSpacingBefore;
+ delete item.innerSpacingAfter;
+ var url = item.url;
+ item.url = "___CSS_LOADER_URL___" + urlItems.length + "___";
+ urlItems.push({
+ url: url
+ });
+ }
+ break;
+ }
+ }
+
+ css.walkDecls(function(decl) {
+ var values = Tokenizer.parseValues(decl.value);
+ values.nodes.forEach(function(value) {
+ value.nodes.forEach(processNode);
+ });
+ decl.value = Tokenizer.stringifyValues(values);
+ });
+ css.walkAtRules(function(atrule) {
+ if(typeof atrule.params === "string") {
+ atrule.params = replaceImportsInString(atrule.params);
+ }
+ });
+
+ options.importItems = importItems;
+ options.urlItems = urlItems;
+ options.exports = exports;
+ };
+});
+
+module.exports = function processCss(inputSource, inputMap, options, callback) {
+ var query = options.query;
+ var root = query.root && query.root.length > 0 ? query.root.replace(/\/$/, "") : query.root;
+ var context = query.context;
+ var localIdentName = query.localIdentName || "[hash:base64]";
+ var localIdentRegExp = query.localIdentRegExp;
+ var forceMinimize = query.minimize;
+ var minimize = typeof forceMinimize !== "undefined" ? !!forceMinimize : options.minimize;
+
+ var customGetLocalIdent = query.getLocalIdent || getLocalIdent;
+
+ var parserOptions = {
+ root: root,
+ mode: options.mode,
+ url: query.url !== false,
+ import: query.import !== false,
+ resolve: options.resolve
+ };
+
+ var pipeline = postcss([
+ modulesValues,
+ localByDefault({
+ mode: options.mode,
+ rewriteUrl: function(global, url) {
+ if(parserOptions.url){
+ url = url.trim();
+
+ if(!url.replace(/\s/g, '').length || !loaderUtils.isUrlRequest(url, root)) {
+ return url;
+ }
+ if(global) {
+ return loaderUtils.urlToRequest(url, root);
+ }
+ }
+ return url;
+ }
+ }),
+ extractImports(),
+ modulesScope({
+ generateScopedName: function generateScopedName (exportName) {
+ return customGetLocalIdent(options.loaderContext, localIdentName, exportName, {
+ regExp: localIdentRegExp,
+ hashPrefix: query.hashPrefix || "",
+ context: context
+ });
+ }
+ }),
+ parserPlugin(parserOptions)
+ ]);
+
+ if(minimize) {
+ var cssnano = require("cssnano");
+ var minimizeOptions = assign({}, query.minimize);
+ ["zindex", "normalizeUrl", "discardUnused", "mergeIdents", "reduceIdents", "autoprefixer"].forEach(function(name) {
+ if(typeof minimizeOptions[name] === "undefined")
+ minimizeOptions[name] = false;
+ });
+ pipeline.use(cssnano(minimizeOptions));
+ }
+
+ pipeline.process(inputSource, {
+ // we need a prefix to avoid path rewriting of PostCSS
+ from: "/css-loader!" + options.from,
+ to: options.to,
+ map: options.sourceMap ? {
+ prev: inputMap,
+ sourcesContent: true,
+ inline: false,
+ annotation: false
+ } : null
+ }).then(function(result) {
+ callback(null, {
+ source: result.css,
+ map: result.map && result.map.toJSON(),
+ exports: parserOptions.exports,
+ importItems: parserOptions.importItems,
+ importItemRegExpG: /___CSS_LOADER_IMPORT___([0-9]+)___/g,
+ importItemRegExp: /___CSS_LOADER_IMPORT___([0-9]+)___/,
+ urlItems: parserOptions.urlItems,
+ urlItemRegExpG: /___CSS_LOADER_URL___([0-9]+)___/g,
+ urlItemRegExp: /___CSS_LOADER_URL___([0-9]+)___/
+ });
+ }).catch(function(err) {
+ if (err.name === 'CssSyntaxError') {
+ var wrappedError = new CSSLoaderError(
+ 'Syntax Error',
+ err.reason,
+ err.line != null && err.column != null
+ ? {line: err.line, column: err.column}
+ : null,
+ err.input.source
+ );
+ callback(wrappedError);
+ } else {
+ callback(err);
+ }
+ });
+};
+
+function formatMessage(message, loc, source) {
+ var formatted = message;
+ if (loc) {
+ formatted = formatted
+ + ' (' + loc.line + ':' + loc.column + ')';
+ }
+ if (loc && source) {
+ formatted = formatted
+ + '\n\n' + formatCodeFrame(source, loc.line, loc.column) + '\n';
+ }
+ return formatted;
+}
+
+function CSSLoaderError(name, message, loc, source, error) {
+ Error.call(this);
+ Error.captureStackTrace(this, CSSLoaderError);
+ this.name = name;
+ this.error = error;
+ this.message = formatMessage(message, loc, source);
+ this.hideStack = true;
+}
+
+CSSLoaderError.prototype = Object.create(Error.prototype);
+CSSLoaderError.prototype.constructor = CSSLoaderError;
diff --git a/node_modules/css-loader/lib/url/escape.js b/node_modules/css-loader/lib/url/escape.js
new file mode 100644
index 00000000..25074a6e
--- /dev/null
+++ b/node_modules/css-loader/lib/url/escape.js
@@ -0,0 +1,16 @@
+module.exports = function escape(url) {
+ if (typeof url !== 'string') {
+ return url
+ }
+ // If url is already wrapped in quotes, remove them
+ if (/^['"].*['"]$/.test(url)) {
+ url = url.slice(1, -1);
+ }
+ // Should url be wrapped?
+ // See https://drafts.csswg.org/css-values-3/#urls
+ if (/["'() \t\n]/.test(url)) {
+ return '"' + url.replace(/"/g, '\\"').replace(/\n/g, '\\n') + '"'
+ }
+
+ return url
+}
diff --git a/node_modules/css-loader/locals.js b/node_modules/css-loader/locals.js
new file mode 100644
index 00000000..2a85707e
--- /dev/null
+++ b/node_modules/css-loader/locals.js
@@ -0,0 +1,5 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+module.exports = require("./lib/localsLoader");
diff --git a/node_modules/css-loader/package.json b/node_modules/css-loader/package.json
new file mode 100644
index 00000000..afc18e80
--- /dev/null
+++ b/node_modules/css-loader/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "css-loader",
+ "version": "0.28.11",
+ "author": "Tobias Koppers @sokra",
+ "license": "MIT",
+ "description": "css loader module for webpack",
+ "engines": {
+ "node": ">=0.12.0 || >= 4.3.0 < 5.0.0 || >=5.10"
+ },
+ "files": [
+ "lib",
+ "index.js",
+ "locals.js"
+ ],
+ "dependencies": {
+ "babel-code-frame": "^6.26.0",
+ "css-selector-tokenizer": "^0.7.0",
+ "cssnano": "^3.10.0",
+ "icss-utils": "^2.1.0",
+ "loader-utils": "^1.0.2",
+ "lodash.camelcase": "^4.3.0",
+ "object-assign": "^4.1.1",
+ "postcss": "^5.0.6",
+ "postcss-modules-extract-imports": "^1.2.0",
+ "postcss-modules-local-by-default": "^1.2.0",
+ "postcss-modules-scope": "^1.1.0",
+ "postcss-modules-values": "^1.3.0",
+ "postcss-value-parser": "^3.3.0",
+ "source-list-map": "^2.0.0"
+ },
+ "devDependencies": {
+ "codecov": "^1.0.1",
+ "eslint": "3.14.0",
+ "istanbul": "^0.4.5",
+ "mocha": "^3.2.0",
+ "should": "^11.1.2",
+ "standard-version": "^4.0.0"
+ },
+ "scripts": {
+ "lint": "eslint lib test",
+ "test": "mocha",
+ "cover": "istanbul cover node_modules/mocha/bin/_mocha",
+ "test:cover": "npm run cover -- --report lcovonly",
+ "travis:test": "npm run cover",
+ "travis:lint": "npm run lint",
+ "release": "standard-version"
+ },
+ "homepage": "https://github.com/webpack-contrib/css-loader",
+ "repository": "https://github.com/webpack-contrib/css-loader.git",
+ "bugs": "https://github.com/webpack-contrib/css-loader/issues"
+}