mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
549
web/node_modules/sass-loader/CHANGELOG.md
generated
vendored
Normal file
549
web/node_modules/sass-loader/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,549 @@
|
|||
# Changelog
|
||||
|
||||
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.
|
||||
|
||||
## [10.2.0](https://github.com/webpack-contrib/sass-loader/compare/v10.1.1...v10.2.0) (2021-05-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support `node-sass` v6 ([dbbbdde](https://github.com/webpack-contrib/sass-loader/commit/dbbbdde8d73b5ebac89fdc3ca7009a644a471c5f))
|
||||
|
||||
### [10.1.1](https://github.com/webpack-contrib/sass-loader/compare/v10.1.0...v10.1.1) (2021-01-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* problem with resolving and the `includePaths` option ([#913](https://github.com/webpack-contrib/sass-loader/issues/913)) ([cadc75e](https://github.com/webpack-contrib/sass-loader/commit/cadc75e80caf7d32ea47de1cbaab639f9204c0eb))
|
||||
|
||||
## [10.1.0](https://github.com/webpack-contrib/sass-loader/compare/v10.0.5...v10.1.0) (2020-11-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow the `additionalData` to be async ([#902](https://github.com/webpack-contrib/sass-loader/issues/902)) ([9d925ff](https://github.com/webpack-contrib/sass-loader/commit/9d925ff794e1e4cb9db253a6867bfa2405ec3428))
|
||||
|
||||
### [10.0.5](https://github.com/webpack-contrib/sass-loader/compare/v10.0.4...v10.0.5) (2020-11-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* support node-sass v5.0.0 ([#899](https://github.com/webpack-contrib/sass-loader/issues/899)) ([c3e279f](https://github.com/webpack-contrib/sass-loader/commit/c3e279fb4668fce4c597a6c8cd1d0f2ff8bc95e5))
|
||||
|
||||
### [10.0.4](https://github.com/webpack-contrib/sass-loader/compare/v10.0.3...v10.0.4) (2020-10-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* compatibility with the filesystem cache ([#896](https://github.com/webpack-contrib/sass-loader/issues/896)) ([e31f9b6](https://github.com/webpack-contrib/sass-loader/commit/e31f9b682f62e957fd2075582c3cf6cf0daf6b52))
|
||||
|
||||
### [10.0.3](https://github.com/webpack-contrib/sass-loader/compare/v10.0.2...v10.0.3) (2020-10-09)
|
||||
|
||||
### Chore
|
||||
|
||||
* update `schema-utils`
|
||||
|
||||
### [10.0.2](https://github.com/webpack-contrib/sass-loader/compare/v10.0.1...v10.0.2) (2020-09-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* source maps generation ([#886](https://github.com/webpack-contrib/sass-loader/issues/886)) ([8327d55](https://github.com/webpack-contrib/sass-loader/commit/8327d55df9e8fc6e24d2759d7bd50174ed1ff1e4))
|
||||
|
||||
### [10.0.1](https://github.com/webpack-contrib/sass-loader/compare/v10.0.0...v10.0.1) (2020-08-25)
|
||||
|
||||
### Chore
|
||||
|
||||
* update deps
|
||||
|
||||
## [10.0.0](https://github.com/webpack-contrib/sass-loader/compare/v10.0.0-rc.0...v10.0.0) (2020-08-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* handle absolute windows path in source maps
|
||||
|
||||
## [10.0.0-rc.0](https://github.com/webpack-contrib/sass-loader/compare/v9.0.3...v10.0.0-rc.0) (2020-08-24)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* loader generates absolute `sources` in source maps, also avoids modifying `sass` source maps if the `sourceMap` option is `false`
|
||||
|
||||
### [9.0.3](https://github.com/webpack-contrib/sass-loader/compare/v9.0.2...v9.0.3) (2020-08-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* resolution algorithm ([#875](https://github.com/webpack-contrib/sass-loader/issues/875)) ([ea73cfa](https://github.com/webpack-contrib/sass-loader/commit/ea73cfab047c751e1055d0c2ec58ef503f7dbe36))
|
||||
|
||||
### [9.0.2](https://github.com/webpack-contrib/sass-loader/compare/v9.0.1...v9.0.2) (2020-07-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* resolution algorithm for `node-sass` ([#866](https://github.com/webpack-contrib/sass-loader/issues/866)) ([4584c90](https://github.com/webpack-contrib/sass-loader/commit/4584c9054befbc56661e2781a55df96fb9f94673))
|
||||
|
||||
### [9.0.1](https://github.com/webpack-contrib/sass-loader/compare/v9.0.0...v9.0.1) (2020-07-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* do not crash on errors ([#860](https://github.com/webpack-contrib/sass-loader/issues/860)) ([e854933](https://github.com/webpack-contrib/sass-loader/commit/e8549330f8d9373ff8baccffbfd3e0c3b6f3ef61))
|
||||
|
||||
## [9.0.0](https://github.com/webpack-contrib/sass-loader/compare/v8.0.2...v9.0.0) (2020-07-02)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* minimum supported Nodejs version is `10.13`
|
||||
* prefer `sass` (`dart-sass`) by default, it is strongly recommended to migrate on `sass` (`dart-sass`)
|
||||
* the `prependData` option was removed in favor the `additionalData` option, see [docs](https://github.com/webpack-contrib/sass-loader#additionaldata)
|
||||
* when the `sourceMap` is `true`, `sassOptions.sourceMap`, `sassOptions.sourceMapContents`, `sassOptions.sourceMapEmbed`, `sassOptions.sourceMapRoot` and `sassOptions.omitSourceMapUrl` will be ignored.
|
||||
|
||||
### Features
|
||||
|
||||
* pass the loader context to custom importers under the `this.webpackLoaderContext` property ([#853](https://github.com/webpack-contrib/sass-loader/issues/853)) ([d487683](https://github.com/webpack-contrib/sass-loader/commit/d487683221fcd1e5a173e083b4b40644751c8cb1))
|
||||
* supports for `process.cwd()` resolution logic by default ([#837](https://github.com/webpack-contrib/sass-loader/issues/837)) ([0c8d3b3](https://github.com/webpack-contrib/sass-loader/commit/0c8d3b3fb1cf371779b4a886cfc4e60facf68759))
|
||||
* supports for `SASS-PATH` env variable resolution logic by default ([#836](https://github.com/webpack-contrib/sass-loader/issues/836)) ([8376179](https://github.com/webpack-contrib/sass-loader/commit/83761798380dcccc5a2badde3b3affe2bac385e8))
|
||||
* supports for the `sass` property for the `exports` field from `package.json` (conditional exports, for more information read [docs](https://nodejs.org/api/esm.html))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* avoid different content on different os ([#832](https://github.com/webpack-contrib/sass-loader/issues/832)) ([68dd278](https://github.com/webpack-contrib/sass-loader/commit/68dd27883ce0536adc5bc170816242c67fb118ff))
|
||||
* resolution logic when the `includePaths` option used was improved ([#827](https://github.com/webpack-contrib/sass-loader/issues/827)) ([cbe5ad4](https://github.com/webpack-contrib/sass-loader/commit/cbe5ad407582a617be097d3eadd3ad8619e52507))
|
||||
* resolution logic for `file://` scheme was improved ([17832fd](https://github.com/webpack-contrib/sass-loader/commit/17832fdb11f91593f4e2995003d67aebefb3be90))
|
||||
* resolution logic for absolute paths and server relative URLs was improved
|
||||
* source maps generation was improved
|
||||
|
||||
### [8.0.2](https://github.com/webpack-contrib/sass-loader/compare/v8.0.1...v8.0.2) (2020-01-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* compatibility with node@8 ([#798](https://github.com/webpack-contrib/sass-loader/issues/798)) ([6f3852f](https://github.com/webpack-contrib/sass-loader/commit/6f3852f7d393dd0bc8f8d264d81ecc941bc72511))
|
||||
|
||||
### [8.0.1](https://github.com/webpack-contrib/sass-loader/compare/v8.0.0...v8.0.1) (2020-01-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* support webpack@5 ([#794](https://github.com/webpack-contrib/sass-loader/issues/794)) ([6c59e37](https://github.com/webpack-contrib/sass-loader/commit/6c59e37e3f67668d7a3908444ddfc0176bc5601f))
|
||||
|
||||
## [8.0.0](https://github.com/webpack-contrib/sass-loader/compare/v7.3.1...v8.0.0) (2019-08-29)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* minimum required `webpack` version is `4.36.0`
|
||||
* minimum required `node.js` version is `8.9.0`
|
||||
* move all sass (`includePaths`, `importer`, `functions`, `outputStyle`) options to the `sassOptions` option. The `functions` option can't be used as `Function`, you should use `sassOption` as `Function` to achieve this.
|
||||
* the `data` option was renamed to the `prependData` option
|
||||
* default value of the `sourceMap` option depends on the `devtool` value (`eval`/`false` values don't enable source map generation)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* automatically use the `fibers` package if it is possible ([#744](https://github.com/webpack-contrib/sass-loader/issues/744)) ([96184e1](https://github.com/webpack-contrib/sass-loader/commit/96184e1))
|
||||
* source map generation depends on the `devtool` option ([#743](https://github.com/webpack-contrib/sass-loader/issues/743)) ([fcea88e](https://github.com/webpack-contrib/sass-loader/commit/fcea88e))
|
||||
* validate loader options ([#737](https://github.com/webpack-contrib/sass-loader/issues/737)) ([7b543fc](https://github.com/webpack-contrib/sass-loader/commit/7b543fc))
|
||||
* reworked error handling from `node-sass`/`sass`
|
||||
* improve resolution for `@import` (including support `_index` and `index` files in a directory)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* compatibility with `pnp`
|
||||
|
||||
|
||||
### [7.3.1](https://github.com/webpack-contrib/sass-loader/compare/v7.3.0...v7.3.1) (2019-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* minimum `node` version in `package.json` ([#733](https://github.com/webpack-contrib/sass-loader/issues/733)) ([1175920](https://github.com/webpack-contrib/sass-loader/commit/1175920))
|
||||
|
||||
## [7.3.0](https://github.com/webpack-contrib/sass-loader/compare/v7.2.0...v7.3.0) (2019-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* handle module import ending `/` as module ([#728](https://github.com/webpack-contrib/sass-loader/issues/728)) ([997a255](https://github.com/webpack-contrib/sass-loader/commit/997a255))
|
||||
* resolution algorithm ([#720](https://github.com/webpack-contrib/sass-loader/issues/720)) ([0e94940](https://github.com/webpack-contrib/sass-loader/commit/0e94940))
|
||||
* use "compressed" output when mode is "production" ([#723](https://github.com/webpack-contrib/sass-loader/issues/723)) ([b2af379](https://github.com/webpack-contrib/sass-loader/commit/b2af379))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `webpackImporter` option ([#732](https://github.com/webpack-contrib/sass-loader/issues/732)) ([6f4ea37](https://github.com/webpack-contrib/sass-loader/commit/6f4ea37))
|
||||
|
||||
<a name="7.2.0"></a>
|
||||
# [7.2.0](https://github.com/webpack-contrib/sass-loader/compare/v7.1.0...v7.2.0) (2019-08-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* better handle stdin in sources ([#681](https://github.com/webpack-contrib/sass-loader/issues/681)) ([e279f2a](https://github.com/webpack-contrib/sass-loader/commit/e279f2a))
|
||||
* prefer `sass`/`scss`/`css` extensions ([#711](https://github.com/webpack-contrib/sass-loader/issues/711)) ([6fc9d4e](https://github.com/webpack-contrib/sass-loader/commit/6fc9d4e))
|
||||
* relax node engine ([#708](https://github.com/webpack-contrib/sass-loader/issues/708)) ([2a51502](https://github.com/webpack-contrib/sass-loader/commit/2a51502))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow passing `functions` option as function ([#651](https://github.com/webpack-contrib/sass-loader/issues/651)) ([6c9654d](https://github.com/webpack-contrib/sass-loader/commit/6c9654d))
|
||||
* support `data` as `Function` ([#648](https://github.com/webpack-contrib/sass-loader/issues/648)) ([aa64e1b](https://github.com/webpack-contrib/sass-loader/commit/aa64e1b))
|
||||
* support `sass` and `style` fields in `package.json` ([#647](https://github.com/webpack-contrib/sass-loader/issues/647)) ([a8709c9](https://github.com/webpack-contrib/sass-loader/commit/a8709c9))
|
||||
* support auto resolving `dart-sass` ([ff90dd6](https://github.com/webpack-contrib/sass-loader/commit/ff90dd6))
|
||||
|
||||
|
||||
|
||||
<a name="7.1.0"></a>
|
||||
# [7.1.0](https://github.com/webpack-contrib/sass-loader/compare/v7.0.3...v7.1.0) (2018-08-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Make this package implementation-agnostic (#573) ([bed9fb5](https://github.com/webpack-contrib/sass-loader/commit/bed9fb5)), closes [#435](https://github.com/webpack-contrib/sass-loader/issues/435)
|
||||
|
||||
|
||||
|
||||
<a name="7.0.3"></a>
|
||||
## [7.0.3](https://github.com/webpack-contrib/sass-loader/compare/v7.0.2...v7.0.3) (2018-06-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Bare imports not working sometimes (#579) ([c348281](https://github.com/webpack-contrib/sass-loader/commit/c348281)), closes [#566](https://github.com/webpack-contrib/sass-loader/issues/566)
|
||||
|
||||
|
||||
|
||||
<a name="7.0.2"></a>
|
||||
## [7.0.2](https://github.com/webpack-contrib/sass-loader/compare/v7.0.1...v7.0.2) (2018-06-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Errors being swallowed when trying to load node-sass (#576) ([6dfb274](https://github.com/webpack-contrib/sass-loader/commit/6dfb274)), closes [#563](https://github.com/webpack-contrib/sass-loader/issues/563)
|
||||
* Report error to user for problems loading node-sass (#562) ([2529c07](https://github.com/webpack-contrib/sass-loader/commit/2529c07))
|
||||
|
||||
|
||||
|
||||
<a name="7.0.1"></a>
|
||||
## [7.0.1](https://github.com/webpack-contrib/sass-loader/compare/v7.0.0...v7.0.1) (2018-04-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Wrong import precedence (#557) ([f4eeff1](https://github.com/webpack-contrib/sass-loader/commit/f4eeff1))
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0"></a>
|
||||
# [7.0.0](https://github.com/webpack-contrib/sass-loader/compare/v6.0.7...v7.0.0) (2018-04-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Refactor resolving and simplify webpack config aliases (#479) ([e0fde1a](https://github.com/webpack-contrib/sass-loader/commit/e0fde1a))
|
||||
* Remove `node-sass` from `peerDependencies` (#533) ([6439cef](https://github.com/webpack-contrib/sass-loader/commit/6439cef))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Drop official node 4 support
|
||||
* This slightly changes the resolving algorithm. Should not break in normal usage, but might break in complex configurations.
|
||||
* The sass-loader throws an error at runtime now and refuses to compile if the peer dependency is wrong. This could break applications where npm's peer dependency warning was just ignored.
|
||||
|
||||
|
||||
|
||||
<a name="6.0.7"></a>
|
||||
## [6.0.7](https://github.com/webpack-contrib/sass-loader/compare/v6.0.6...v6.0.7) (2018-03-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** add `webpack >= v4.0.0` (`peerDependencies`) ([#541](https://github.com/webpack-contrib/sass-loader/issues/541)) ([620bdd4](https://github.com/webpack-contrib/sass-loader/commit/620bdd4))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* use `neo-async` instead `async` ([#538](https://github.com/webpack-contrib/sass-loader/issues/538)) ([fab89dc](https://github.com/webpack-contrib/sass-loader/commit/fab89dc))
|
||||
|
||||
|
||||
|
||||
<a name="6.0.6"></a>
|
||||
## [6.0.6](https://github.com/webpack-contrib/sass-loader/compare/v6.0.5...v6.0.6) (2017-06-14)
|
||||
|
||||
### Chore
|
||||
|
||||
* Adds Webpack 3.x version range to peerDependencies
|
||||
|
||||
|
||||
<a name="6.0.5"></a>
|
||||
# [6.0.5](https://github.com/webpack-contrib/sass-loader/compare/v6.0.5...v6.0.4) (2017-05-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* importing file directly from scoped npm package [#450](https://github.com/webpack-contrib/sass-loader/pull/450) ([5d06e9d](https://github.com/webpack-contrib/sass-loader/commit/5d06e9d))
|
||||
|
||||
|
||||
<a name="6.0.4"></a>
|
||||
# [6.0.4](https://github.com/webpack-contrib/sass-loader/compare/v6.0.4...v6.0.3) (2017-05-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix: Resolving of scoped npm packages [#447](https://github.com/webpack-contrib/sass-loader/pull/447)
|
||||
|
||||
|
||||
<a name="6.0.3"></a>
|
||||
# [6.0.3](https://github.com/webpack-contrib/sass-loader/compare/v6.0.3...v6.0.2) (2017-03-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix regression with empty files [#398](https://github.com/webpack-contrib/sass-loader/pull/398)
|
||||
|
||||
|
||||
### Chore
|
||||
|
||||
* Reduce npm package size by using the [files](https://docs.npmjs.com/files/package.json#files) property in the `package.json`
|
||||
|
||||
|
||||
<a name="6.0.2"></a>
|
||||
# [6.0.2](https://github.com/webpack-contrib/sass-loader/compare/v6.0.2...v6.0.1) (2017-02-21)
|
||||
|
||||
### Chore
|
||||
|
||||
* Update dependencies [#383](https://github.com/webpack-contrib/sass-loader/pull/383)
|
||||
|
||||
|
||||
<a name="6.0.1"></a>
|
||||
# [6.0.1](https://github.com/webpack-contrib/sass-loader/compare/v6.0.1...v6.0.0) (2017-02-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix source maps in certain CWDs. [#377](https://github.com/webpack-contrib/sass-loader/pull/377)
|
||||
|
||||
|
||||
<a name="6.0.0"></a>
|
||||
# [6.0.0](https://github.com/webpack-contrib/sass-loader/compare/v6.0.0...v5.0.1) (2017-02-13)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Improve source map support. [#374](https://github.com/webpack-contrib/sass-loader/issues/374)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* This is breaking for the resolve-url-loader
|
||||
|
||||
|
||||
<a name="5.0.1"></a>
|
||||
# [5.0.1](https://github.com/webpack-contrib/sass-loader/compare/v5.0.1...v5.0.0) (2017-02-13)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix bug where multiple compilations interfered with each other. [#369](https://github.com/webpack-contrib/sass-loader/pull/369)
|
||||
|
||||
|
||||
<a name="5.0.0"></a>
|
||||
# [5.0.0](https://github.com/webpack-contrib/sass-loader/compare/v5.0.0...v4.1.1) (2017-02-13)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* Remove synchronous compilation support [#334](https://github.com/webpack-contrib/sass-loader/pull/334)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Remove node 0.12 support. [29b30755021a834e622bf4b5bb9db4d6e5913905](https://github.com/webpack-contrib/sass-loader/commit/29b30755021a834e622bf4b5bb9db4d6e5913905)
|
||||
* Remove official node-sass@3 and webpack@1 support. [5a6bcb96d8bd7a7a11c33252ba739ffe09ca38c5](https://github.com/webpack-contrib/sass-loader/commit/5a6bcb96d8bd7a7a11c33252ba739ffe09ca38c5)
|
||||
* Remove synchronous compilation support. [#334](https://github.com/webpack-contrib/sass-loader/pull/334)
|
||||
|
||||
|
||||
<a name="4.1.1"></a>
|
||||
# [4.1.1](https://github.com/webpack-contrib/sass-loader/compare/v4.1.1...v4.1.0) (2016-12-21)
|
||||
|
||||
### Chore
|
||||
|
||||
* Update webpack peer dependency to support 2.2.0rc. [#330](https://github.com/webpack-contrib/sass-loader/pull/330)
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
# [4.1.0](https://github.com/webpack-contrib/sass-loader/compare/v4.1.0...v4.0.2) (2016-12-14)
|
||||
|
||||
### Features
|
||||
|
||||
* Update `node-sass@4.0.0` [#319](https://github.com/webpack-contrib/sass-loader/pull/319)
|
||||
|
||||
|
||||
<a name="4.0.2"></a>
|
||||
# [4.0.2](https://github.com/webpack-contrib/sass-loader/compare/v4.0.2...v4.0.1) (2016-07-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix wrong context in customImporters [#281](https://github.com/webpack-contrib/sass-loader/pull/281)
|
||||
|
||||
|
||||
<a name="4.0.1"></a>
|
||||
# [4.0.1](https://github.com/webpack-contrib/sass-loader/compare/v4.0.1...v4.0.0) (2016-07-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix custom importers receiving `'stdin'` as second argument instead of the actual `resourcePath` [#267](https://github.com/webpack-contrib/sass-loader/pull/267)
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
# [4.0.0](https://github.com/webpack-contrib/sass-loader/compare/v4.0.0...v3.2.2) (2016-06-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix incorrect source map paths [#250](https://github.com/webpack-contrib/sass-loader/pull/250)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Release new major version because the previous release was a breaking change in certain scenarios
|
||||
See: https://github.com/webpack-contrib/sass-loader/pull/250#issuecomment-228663059
|
||||
|
||||
|
||||
<a name="3.2.2"></a>
|
||||
# [3.2.2](https://github.com/webpack-contrib/sass-loader/compare/v3.2.2...v3.2.1) (2016-06-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix incorrect source map paths [#250](https://github.com/webpack-contrib/sass-loader/pull/250)
|
||||
|
||||
|
||||
<a name="3.2.1"></a>
|
||||
# [3.2.1](https://github.com/webpack-contrib/sass-loader/compare/v3.2.1...v3.2.0) (2016-06-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add `webpack@^2.1.0-beta` as peer dependency [#233](https://github.com/webpack-contrib/sass-loader/pull/233)
|
||||
|
||||
|
||||
<a name="3.2.0"></a>
|
||||
# [3.2.0](https://github.com/webpack-contrib/sass-loader/compare/v3.2.0...v3.1.2) (2016-03-12)
|
||||
|
||||
### Features
|
||||
|
||||
* Append file content instead of overwriting when `data`-option is already present [#216](https://github.com/webpack-contrib/sass-loader/pull/216)
|
||||
* Make `indentedSyntax` option a bit smarter [#196](https://github.com/webpack-contrib/sass-loader/pull/196)
|
||||
|
||||
|
||||
<a name="3.1.2"></a>
|
||||
# [3.1.2](https://github.com/webpack-contrib/sass-loader/compare/v3.1.2...v3.1.1) (2015-11-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix loader query not overriding webpack config [#189](https://github.com/webpack-contrib/sass-loader/pull/189)
|
||||
* Update peer-dependencies [#182](https://github.com/webpack-contrib/sass-loader/pull/182)
|
||||
- `node-sass^3.4.2`
|
||||
- `webpack^1.12.6`
|
||||
|
||||
|
||||
<a name="3.1.1"></a>
|
||||
# [3.1.1](https://github.com/webpack-contrib/sass-loader/compare/v3.1.1...v3.1.0) (2015-10-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix missing module `object-assign` [#178](https://github.com/webpack-contrib/sass-loader/issues/178)
|
||||
|
||||
|
||||
<a name="3.1.0"></a>
|
||||
# [3.1.0](https://github.com/webpack-contrib/sass-loader/compare/v3.1.0...v3.0.0) (2015-10-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix a problem where modules with a `.` in their names were not resolved [#167](https://github.com/webpack-contrib/sass-loader/issues/167)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add possibility to also define all options in your `webpack.config.js` [#152](https://github.com/webpack-contrib/sass-loader/pull/152) [#170](https://github.com/webpack-contrib/sass-loader/pull/170)
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/webpack-contrib/sass-loader/compare/v3.0.0...v2.0.1) (2015-09-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix crash when Sass reported an error without `file` [#158](https://github.com/webpack-contrib/sass-loader/pull/158)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Add `node-sass@^3.3.3` and `webpack@^1.12.2` as peer-dependency [#165](https://github.com/webpack-contrib/sass-loader/pull/165) [#166](https://github.com/webpack-contrib/sass-loader/pull/166) [#169](https://github.com/webpack-contrib/sass-loader/pull/169)
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
# [2.0.1](https://github.com/webpack-contrib/sass-loader/compare/v2.0.1...v2.0.0) (2015-08-14)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add missing path normalization (fixes [#141](https://github.com/webpack-contrib/sass-loader/pull/141))
|
||||
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/webpack-contrib/sass-loader/compare/v2.0.0...v1.0.4) (2015-08-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add temporary fix for stuck processes (see [sass/node-sass#857](https://github.com/sass/node-sass/issues/857)) [#100](https://github.com/webpack-contrib/sass-loader/issues/100) [#119](https://github.com/webpack-contrib/sass-loader/issues/119) [#132](https://github.com/webpack-contrib/sass-loader/pull/132)
|
||||
* Fix path resolving on Windows [#108](https://github.com/webpack-contrib/sass-loader/issues/108)
|
||||
* Fix file watchers on Windows [#102](https://github.com/webpack-contrib/sass-loader/issues/102)
|
||||
* Fix file watchers for files with errors [#134](https://github.com/webpack-contrib/sass-loader/pull/134)
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* Refactor [import resolving algorithm](https://github.com/webpack-contrib/sass-loader/blob/089c52dc9bd02ec67fb5c65c2c226f43710f231c/index.js#L293-L348). ([#138](https://github.com/webpack-contrib/sass-loader/issues/138)) ([c8621a1](https://github.com/webpack-contrib/sass-loader/commit/80944ccf09cd9716a100160c068d255c5d742338))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* The new algorithm is aligned to libsass' way of resolving files. This yields to different results if two files with the same path and filename but with different extensions are present. Though this change should be no problem for most users, we must flag it as breaking change. [#135](https://github.com/webpack-contrib/sass-loader/issues/135) [#138](https://github.com/webpack-contrib/sass-loader/issues/138)
|
||||
|
||||
|
||||
<a name="1.0.4"></a>
|
||||
# [1.0.4](https://github.com/webpack-contrib/sass-loader/compare/v1.0.4...v1.0.3) (2015-08-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix wrong source-map urls [#123](https://github.com/webpack-contrib/sass-loader/pull/123)
|
||||
* Include source-map contents by default [#104](https://github.com/webpack-contrib/sass-loader/pull/104)
|
||||
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
# [1.0.3](https://github.com/webpack-contrib/sass-loader/compare/v1.0.3...v1.0.2) (2015-07-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix importing css files from scss/sass [#101](https://github.com/webpack-contrib/sass-loader/issues/101)
|
||||
* Fix importing Sass partials from includePath [#98](https://github.com/webpack-contrib/sass-loader/issues/98) [#110](https://github.com/webpack-contrib/sass-loader/issues/110)
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
# [1.0.2](https://github.com/webpack-contrib/sass-loader/compare/v1.0.2...v1.0.1) (2015-04-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix a bug where files could not be imported across language styles [#73](https://github.com/webpack-contrib/sass-loader/issues/73)
|
||||
* Update peer-dependency `node-sass` to `3.1.0`
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
# [1.0.1](https://github.com/webpack-contrib/sass-loader/compare/v1.0.1...v1.0.0) (2015-03-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix Sass partials not being resolved anymore [#68](https://github.com/webpack-contrib/sass-loader/issues/68)
|
||||
* Update peer-dependency `node-sass` to `3.0.0-beta.4`
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://github.com/webpack-contrib/sass-loader/compare/v1.0.0...v0.3.1) (2015-03-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Moved `node-sass^3.0.0-alpha.0` to `peerDependencies` [#28](https://github.com/webpack-contrib/sass-loader/issues/28)
|
||||
* Using webpack's module resolver as custom importer [#39](https://github.com/webpack-contrib/sass-loader/issues/31)
|
||||
* Add synchronous compilation support for usage with [enhanced-require](https://github.com/webpack/enhanced-require) [#39](https://github.com/webpack-contrib/sass-loader/pull/39)
|
20
web/node_modules/sass-loader/LICENSE
generated
vendored
Normal file
20
web/node_modules/sass-loader/LICENSE
generated
vendored
Normal file
|
@ -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.
|
668
web/node_modules/sass-loader/README.md
generated
vendored
Normal file
668
web/node_modules/sass-loader/README.md
generated
vendored
Normal file
|
@ -0,0 +1,668 @@
|
|||
<div align="center">
|
||||
<img height="100"
|
||||
src="https://worldvectorlogo.com/logos/sass-1.svg">
|
||||
<a href="https://github.com/webpack/webpack">
|
||||
<img width="200" height="200"
|
||||
src="https://webpack.js.org/assets/icon-square-big.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
[![npm][npm]][npm-url]
|
||||
[![node][node]][node-url]
|
||||
[![deps][deps]][deps-url]
|
||||
[![tests][tests]][tests-url]
|
||||
[![coverage][cover]][cover-url]
|
||||
[![chat][chat]][chat-url]
|
||||
[![size][size]][size-url]
|
||||
|
||||
# sass-loader
|
||||
|
||||
Loads a Sass/SCSS file and compiles it to CSS.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To begin, you'll need to install `sass-loader`:
|
||||
|
||||
```console
|
||||
npm install sass-loader sass webpack --save-dev
|
||||
```
|
||||
|
||||
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass) or [Node Sass](https://github.com/sass/node-sass) on your own (more documentation can be found below).
|
||||
|
||||
This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.
|
||||
|
||||
> ℹ️ We recommend using [Dart Sass](https://github.com/sass/dart-sass).
|
||||
|
||||
> ⚠ [Node Sass](https://github.com/sass/node-sass) does not work with [Yarn PnP](https://classic.yarnpkg.com/en/docs/pnp/) feature.
|
||||
|
||||
Chain the `sass-loader` with the [css-loader](https://github.com/webpack-contrib/css-loader) and the [style-loader](https://github.com/webpack-contrib/style-loader) to immediately apply all styles to the DOM or the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract it into a separate file.
|
||||
|
||||
Then add the loader to your Webpack configuration. For example:
|
||||
|
||||
**app.js**
|
||||
|
||||
```js
|
||||
import "./style.scss";
|
||||
```
|
||||
|
||||
**style.scss**
|
||||
|
||||
```scss
|
||||
$body-color: red;
|
||||
|
||||
body {
|
||||
color: $body-color;
|
||||
}
|
||||
```
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
// Creates `style` nodes from JS strings
|
||||
"style-loader",
|
||||
// Translates CSS into CommonJS
|
||||
"css-loader",
|
||||
// Compiles Sass to CSS
|
||||
"sass-loader",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
Finally run `webpack` via your preferred method.
|
||||
|
||||
### Resolving `import` at-rules
|
||||
|
||||
Webpack provides an [advanced mechanism to resolve files](https://webpack.js.org/concepts/module-resolution/).
|
||||
|
||||
The `sass-loader` uses Sass's custom importer feature to pass all queries to the Webpack resolving engine. Thus you can import your Sass modules from `node_modules`. Just prepend them with a `~` to tell Webpack that this is not a relative import:
|
||||
|
||||
```scss
|
||||
@import "~bootstrap";
|
||||
```
|
||||
|
||||
It's important to only prepend it with `~`, because `~/` resolves to the home directory.
|
||||
Webpack needs to distinguish between `bootstrap` and `~bootstrap` because CSS and Sass files have no special syntax for importing relative files.
|
||||
Writing `@import "style.scss"` is the same as `@import "./style.scss";`
|
||||
|
||||
### Problems with `url(...)`
|
||||
|
||||
Since Sass implementations don't provide [url rewriting](https://github.com/sass/libsass/issues/532), all linked assets must be relative to the output.
|
||||
|
||||
- If you pass the generated CSS on to the `css-loader`, all urls must be relative to the entry-file (e.g. `main.scss`).
|
||||
- If you're just generating CSS without passing it to the `css-loader`, it must be relative to your web root.
|
||||
|
||||
You will be disrupted by this first issue. It is natural to expect relative references to be resolved against the `.sass`/`.scss` file in which they are specified (like in regular `.css` files).
|
||||
|
||||
Thankfully there are a two solutions to this problem:
|
||||
|
||||
- Add the missing url rewriting using the [resolve-url-loader](https://github.com/bholloway/resolve-url-loader). Place it before `sass-loader` in the loader chain.
|
||||
- Library authors usually provide a variable to modify the asset path. [bootstrap-sass](https://github.com/twbs/bootstrap-sass) for example has an `$icon-font-path`.
|
||||
|
||||
## Options
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| :---------------------------------------: | :------------------: | :-------------------------------------: | :---------------------------------------------------------------- |
|
||||
| **[`implementation`](#implementation)** | `{Object}` | `sass` | Setup Sass implementation to use. |
|
||||
| **[`sassOptions`](#sassoptions)** | `{Object\|Function}` | defaults values for Sass implementation | Options for Sass. |
|
||||
| **[`sourceMap`](#sourcemap)** | `{Boolean}` | `compiler.devtool` | Enables/Disables generation of source maps. |
|
||||
| **[`additionalData`](#additionaldata)** | `{String\|Function}` | `undefined` | Prepends/Appends `Sass`/`SCSS` code before the actual entry file. |
|
||||
| **[`webpackImporter`](#webpackimporter)** | `{Boolean}` | `true` | Enables/Disables the default Webpack importer. |
|
||||
|
||||
### `implementation`
|
||||
|
||||
Type: `Object`
|
||||
Default: `sass`
|
||||
|
||||
The special `implementation` option determines which implementation of Sass to use.
|
||||
|
||||
By default the loader resolve the implementation based on your dependencies.
|
||||
Just add required implementation to `package.json` (`sass` or `node-sass` package) and install dependencies.
|
||||
|
||||
Example where the `sass-loader` loader uses the `sass` (`dart-sass`) implementation:
|
||||
|
||||
**package.json**
|
||||
|
||||
```json
|
||||
{
|
||||
"devDependencies": {
|
||||
"sass-loader": "^7.2.0",
|
||||
"sass": "^1.22.10"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Example where the `sass-loader` loader uses the `node-sass` implementation:
|
||||
|
||||
**package.json**
|
||||
|
||||
```json
|
||||
{
|
||||
"devDependencies": {
|
||||
"sass-loader": "^7.2.0",
|
||||
"node-sass": "^5.0.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Beware the situation when `node-sass` and `sass` were installed! By default the `sass-loader` prefers `sass`.
|
||||
In order to avoid this situation you can use the `implementation` option.
|
||||
|
||||
The `implementation` options either accepts `sass` (`Dart Sass`) or `node-sass` as a module.
|
||||
|
||||
For example, to use Dart Sass, you'd pass:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
// Prefer `dart-sass`
|
||||
implementation: require("sass"),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
Note that when using `sass` (`Dart Sass`), **synchronous compilation is twice as fast as asynchronous compilation** by default, due to the overhead of asynchronous callbacks.
|
||||
To avoid this overhead, you can use the [fibers](https://www.npmjs.com/package/fibers) package to call asynchronous importers from the synchronous code path.
|
||||
|
||||
We automatically inject the [`fibers`](https://github.com/laverdet/node-fibers) package (setup `sassOptions.fiber`) if is possible (i.e. you need install the [`fibers`](https://github.com/laverdet/node-fibers) package).
|
||||
|
||||
**package.json**
|
||||
|
||||
```json
|
||||
{
|
||||
"devDependencies": {
|
||||
"sass-loader": "^7.2.0",
|
||||
"sass": "^1.22.10",
|
||||
"fibers": "^4.0.1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can disable automatically injecting the [`fibers`](https://github.com/laverdet/node-fibers) package by passing a `false` value for the `sassOptions.fiber` option.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
implementation: require("sass"),
|
||||
sassOptions: {
|
||||
fiber: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
You can also pass the `fiber` value using this code:
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
implementation: require("sass"),
|
||||
sassOptions: {
|
||||
fiber: require("fibers"),
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `sassOptions`
|
||||
|
||||
Type: `Object|Function`
|
||||
Default: defaults values for Sass implementation
|
||||
|
||||
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://github.com/sass/node-sass) implementation.
|
||||
|
||||
> ℹ️ The `indentedSyntax` option has `true` value for the `sass` extension.
|
||||
|
||||
> ℹ️ Options such as `data` and `file` are unavailable and will be ignored.
|
||||
|
||||
> ℹ We recommend not to set the `outFile`, `sourceMapContents`, `sourceMapEmbed`, `sourceMapRoot` options because `sass-loader` automatically sets these options when the `sourceMap` option is `true`.
|
||||
|
||||
> ℹ️ Access to the [loader context](https://webpack.js.org/api/loaders/#the-loader-context) inside the custom importer can be done using the `this.webpackLoaderContext` property.
|
||||
|
||||
There is a slight difference between the `sass` (`dart-sass`) and `node-sass` options.
|
||||
|
||||
Please consult documentation before using them:
|
||||
|
||||
- [Dart Sass documentation](https://github.com/sass/dart-sass#javascript-api) for all available `sass` options.
|
||||
- [Node Sass documentation](https://github.com/sass/node-sass/#options) for all available `node-sass` options.
|
||||
|
||||
#### `Object`
|
||||
|
||||
Use and object for the Sass implementation setup.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sassOptions: {
|
||||
indentWidth: 4,
|
||||
includePaths: ["absolute/path/a", "absolute/path/b"],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `Function`
|
||||
|
||||
Allows to setup the Sass implementation by setting different options based on the loader context.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sassOptions: (loaderContext) => {
|
||||
// More information about available properties https://webpack.js.org/api/loaders/
|
||||
const { resourcePath, rootContext } = loaderContext;
|
||||
const relativePath = path.relative(rootContext, resourcePath);
|
||||
|
||||
if (relativePath === "styles/foo.scss") {
|
||||
return {
|
||||
includePaths: ["absolute/path/c", "absolute/path/d"],
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
includePaths: ["absolute/path/a", "absolute/path/b"],
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `sourceMap`
|
||||
|
||||
Type: `Boolean`
|
||||
Default: depends on the `compiler.devtool` value
|
||||
|
||||
Enables/Disables generation of source maps.
|
||||
|
||||
By default generation of source maps depends on the [`devtool`](https://webpack.js.org/configuration/devtool/) option.
|
||||
All values enable source map generation except `eval` and `false` value.
|
||||
|
||||
> ℹ If a `true` the `sourceMap`, `sourceMapRoot`, `sourceMapEmbed`, `sourceMapContents` and `omitSourceMapUrl` from `sassOptions` will be ignored.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
> ℹ In some rare cases `node-sass` can output invalid source maps (it is a `node-sass` bug).
|
||||
|
||||
> > In order to avoid this, you can try to update `node-sass` to latest version or you can try to set within `sassOptions` the `outputStyle` option to `compressed`.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sourceMap: true,
|
||||
sassOptions: {
|
||||
outputStyle: "compressed",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `additionalData`
|
||||
|
||||
Type: `String|Function`
|
||||
Default: `undefined`
|
||||
|
||||
Prepends `Sass`/`SCSS` code before the actual entry file.
|
||||
In this case, the `sass-loader` will not override the `data` option but just **prepend** the entry's content.
|
||||
|
||||
This is especially useful when some of your Sass variables depend on the environment:
|
||||
|
||||
#### `String`
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
additionalData: "$env: " + process.env.NODE_ENV + ";",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### `Function`
|
||||
|
||||
##### Sync
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
additionalData: (content, loaderContext) => {
|
||||
// More information about available properties https://webpack.js.org/api/loaders/
|
||||
const { resourcePath, rootContext } = loaderContext;
|
||||
const relativePath = path.relative(rootContext, resourcePath);
|
||||
|
||||
if (relativePath === "styles/foo.scss") {
|
||||
return "$value: 100px;" + content;
|
||||
}
|
||||
|
||||
return "$value: 200px;" + content;
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
##### Async
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
additionalData: async (content, loaderContext) => {
|
||||
// More information about available properties https://webpack.js.org/api/loaders/
|
||||
const { resourcePath, rootContext } = loaderContext;
|
||||
const relativePath = path.relative(rootContext, resourcePath);
|
||||
|
||||
if (relativePath === "styles/foo.scss") {
|
||||
return "$value: 100px;" + content;
|
||||
}
|
||||
|
||||
return "$value: 200px;" + content;
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### `webpackImporter`
|
||||
|
||||
Type: `Boolean`
|
||||
Default: `true`
|
||||
|
||||
Enables/Disables the default Webpack importer.
|
||||
|
||||
This can improve performance in some cases. Use it with caution because aliases and `@import` at-rules starting with `~` will not work.
|
||||
You can pass own `importer` to solve this (see [`importer docs`](https://github.com/sass/node-sass#importer--v200---experimental)).
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
"css-loader",
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
webpackImporter: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Extracts CSS into separate files
|
||||
|
||||
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.
|
||||
|
||||
There are two possibilities to extract a style sheet from the bundle:
|
||||
|
||||
- [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) (use this, when using webpack 4 configuration. Works in all use-cases)
|
||||
- [extract-loader](https://github.com/peerigon/extract-loader) (simpler, but specialized on the css-loader's output)
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```js
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
// fallback to style-loader in development
|
||||
process.env.NODE_ENV !== "production"
|
||||
? "style-loader"
|
||||
: MiniCssExtractPlugin.loader,
|
||||
"css-loader",
|
||||
"sass-loader",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
// Options similar to the same options in webpackOptions.output
|
||||
// both options are optional
|
||||
filename: "[name].css",
|
||||
chunkFilename: "[id].css",
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Source maps
|
||||
|
||||
Enables/Disables generation of source maps.
|
||||
|
||||
To enable CSS source maps, you'll need to pass the `sourceMap` option to the `sass-loader` _and_ the css-loader.
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```javascript
|
||||
module.exports = {
|
||||
devtool: "source-map", // any "source-map"-like devtool is possible
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s[ac]ss$/i,
|
||||
use: [
|
||||
"style-loader",
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
If you want to edit the original Sass files inside Chrome, [there's a good blog post](https://medium.com/@toolmantim/getting-started-with-css-sourcemaps-and-in-browser-sass-editing-b4daab987fb0). Checkout [test/sourceMap](https://github.com/webpack-contrib/sass-loader/tree/master/test) for a running example.
|
||||
|
||||
## Contributing
|
||||
|
||||
Please take a moment to read our contributing guidelines if you haven't yet done so.
|
||||
|
||||
[CONTRIBUTING](./.github/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/sass-loader.svg
|
||||
[npm-url]: https://npmjs.com/package/sass-loader
|
||||
[node]: https://img.shields.io/node/v/sass-loader.svg
|
||||
[node-url]: https://nodejs.org
|
||||
[deps]: https://david-dm.org/webpack-contrib/sass-loader.svg
|
||||
[deps-url]: https://david-dm.org/webpack-contrib/sass-loader
|
||||
[tests]: https://github.com/webpack-contrib/sass-loader/workflows/sass-loader/badge.svg
|
||||
[tests-url]: https://github.com/webpack-contrib/sass-loader/actions
|
||||
[cover]: https://codecov.io/gh/webpack-contrib/sass-loader/branch/master/graph/badge.svg
|
||||
[cover-url]: https://codecov.io/gh/webpack-contrib/sass-loader
|
||||
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
||||
[chat-url]: https://gitter.im/webpack/webpack
|
||||
[size]: https://packagephobia.now.sh/badge?p=sass-loader
|
||||
[size-url]: https://packagephobia.now.sh/result?p=sass-loader
|
32
web/node_modules/sass-loader/dist/SassError.js
generated
vendored
Normal file
32
web/node_modules/sass-loader/dist/SassError.js
generated
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
class SassError extends Error {
|
||||
constructor(sassError) {
|
||||
super();
|
||||
this.name = "SassError";
|
||||
this.originalSassError = sassError;
|
||||
this.loc = {
|
||||
line: sassError.line,
|
||||
column: sassError.column
|
||||
}; // Keep original error if `sassError.formatted` is unavailable
|
||||
|
||||
this.message = `${this.name}: ${this.originalSassError.message}`;
|
||||
|
||||
if (this.originalSassError.formatted) {
|
||||
this.message = `${this.name}: ${this.originalSassError.formatted.replace(/^Error: /, "")}`; // Instruct webpack to hide the JS stack from the console.
|
||||
// Usually you're only interested in the SASS stack in this case.
|
||||
|
||||
this.hideStack = true;
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var _default = SassError;
|
||||
exports.default = _default;
|
5
web/node_modules/sass-loader/dist/cjs.js
generated
vendored
Normal file
5
web/node_modules/sass-loader/dist/cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
const loader = require("./index");
|
||||
|
||||
module.exports = loader.default;
|
85
web/node_modules/sass-loader/dist/index.js
generated
vendored
Normal file
85
web/node_modules/sass-loader/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _schemaUtils = require("schema-utils");
|
||||
|
||||
var _loaderUtils = require("loader-utils");
|
||||
|
||||
var _options = _interopRequireDefault(require("./options.json"));
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
var _SassError = _interopRequireDefault(require("./SassError"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* The sass-loader makes node-sass and dart-sass available to webpack modules.
|
||||
*
|
||||
* @this {object}
|
||||
* @param {string} content
|
||||
*/
|
||||
async function loader(content) {
|
||||
const options = (0, _loaderUtils.getOptions)(this);
|
||||
(0, _schemaUtils.validate)(_options.default, options, {
|
||||
name: "Sass Loader",
|
||||
baseDataPath: "options"
|
||||
});
|
||||
const callback = this.async();
|
||||
const implementation = (0, _utils.getSassImplementation)(this, options.implementation);
|
||||
|
||||
if (!implementation) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
const useSourceMap = typeof options.sourceMap === "boolean" ? options.sourceMap : this.sourceMap;
|
||||
const sassOptions = await (0, _utils.getSassOptions)(this, options, content, implementation, useSourceMap);
|
||||
const shouldUseWebpackImporter = typeof options.webpackImporter === "boolean" ? options.webpackImporter : true;
|
||||
|
||||
if (shouldUseWebpackImporter) {
|
||||
const {
|
||||
includePaths
|
||||
} = sassOptions;
|
||||
sassOptions.importer.push((0, _utils.getWebpackImporter)(this, implementation, includePaths));
|
||||
}
|
||||
|
||||
const render = (0, _utils.getRenderFunctionFromSassImplementation)(implementation);
|
||||
render(sassOptions, (error, result) => {
|
||||
if (error) {
|
||||
// There are situations when the `file` property do not exist
|
||||
if (error.file) {
|
||||
// `node-sass` returns POSIX paths
|
||||
this.addDependency(_path.default.normalize(error.file));
|
||||
}
|
||||
|
||||
callback(new _SassError.default(error));
|
||||
return;
|
||||
}
|
||||
|
||||
let map = result.map ? JSON.parse(result.map) : null; // Modify source paths only for webpack, otherwise we do nothing
|
||||
|
||||
if (map && useSourceMap) {
|
||||
map = (0, _utils.normalizeSourceMap)(map, this.rootContext);
|
||||
}
|
||||
|
||||
result.stats.includedFiles.forEach(includedFile => {
|
||||
const normalizedIncludedFile = _path.default.normalize(includedFile); // Custom `importer` can return only `contents` so includedFile will be relative
|
||||
|
||||
|
||||
if (_path.default.isAbsolute(normalizedIncludedFile)) {
|
||||
this.addDependency(normalizedIncludedFile);
|
||||
}
|
||||
});
|
||||
callback(null, result.css.toString(), map);
|
||||
});
|
||||
}
|
||||
|
||||
var _default = loader;
|
||||
exports.default = _default;
|
41
web/node_modules/sass-loader/dist/options.json
generated
vendored
Normal file
41
web/node_modules/sass-loader/dist/options.json
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"implementation": {
|
||||
"description": "The implementation of the sass to be used (https://github.com/webpack-contrib/sass-loader#implementation).",
|
||||
"type": "object"
|
||||
},
|
||||
"sassOptions": {
|
||||
"description": "Options for `node-sass` or `sass` (`Dart Sass`) implementation. (https://github.com/webpack-contrib/sass-loader#implementation).",
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
{
|
||||
"instanceof": "Function"
|
||||
}
|
||||
]
|
||||
},
|
||||
"additionalData": {
|
||||
"description": "Prepends/Appends `Sass`/`SCSS` code before the actual entry file (https://github.com/webpack-contrib/sass-loader#additionaldata).",
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"instanceof": "Function"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sourceMap": {
|
||||
"description": "Enables/Disables generation of source maps (https://github.com/webpack-contrib/sass-loader#sourcemap).",
|
||||
"type": "boolean"
|
||||
},
|
||||
"webpackImporter": {
|
||||
"description": "Enables/Disables default `webpack` importer (https://github.com/webpack-contrib/sass-loader#webpackimporter).",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
487
web/node_modules/sass-loader/dist/utils.js
generated
vendored
Normal file
487
web/node_modules/sass-loader/dist/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,487 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getSassImplementation = getSassImplementation;
|
||||
exports.getSassOptions = getSassOptions;
|
||||
exports.getWebpackResolver = getWebpackResolver;
|
||||
exports.getWebpackImporter = getWebpackImporter;
|
||||
exports.getRenderFunctionFromSassImplementation = getRenderFunctionFromSassImplementation;
|
||||
exports.normalizeSourceMap = normalizeSourceMap;
|
||||
|
||||
var _url = _interopRequireDefault(require("url"));
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _semver = _interopRequireDefault(require("semver"));
|
||||
|
||||
var _full = require("klona/full");
|
||||
|
||||
var _loaderUtils = require("loader-utils");
|
||||
|
||||
var _neoAsync = _interopRequireDefault(require("neo-async"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function getDefaultSassImplementation() {
|
||||
let sassImplPkg = "sass";
|
||||
|
||||
try {
|
||||
require.resolve("sass");
|
||||
} catch (error) {
|
||||
try {
|
||||
require.resolve("node-sass");
|
||||
|
||||
sassImplPkg = "node-sass";
|
||||
} catch (ignoreError) {
|
||||
sassImplPkg = "sass";
|
||||
}
|
||||
} // eslint-disable-next-line import/no-dynamic-require, global-require
|
||||
|
||||
|
||||
return require(sassImplPkg);
|
||||
}
|
||||
/**
|
||||
* @public
|
||||
* This function is not Webpack-specific and can be used by tools wishing to
|
||||
* mimic `sass-loader`'s behaviour, so its signature should not be changed.
|
||||
*/
|
||||
|
||||
|
||||
function getSassImplementation(loaderContext, implementation) {
|
||||
let resolvedImplementation = implementation;
|
||||
|
||||
if (!resolvedImplementation) {
|
||||
try {
|
||||
resolvedImplementation = getDefaultSassImplementation();
|
||||
} catch (error) {
|
||||
loaderContext.emitError(error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
info
|
||||
} = resolvedImplementation;
|
||||
|
||||
if (!info) {
|
||||
loaderContext.emitError(new Error("Unknown Sass implementation."));
|
||||
return;
|
||||
}
|
||||
|
||||
const infoParts = info.split("\t");
|
||||
|
||||
if (infoParts.length < 2) {
|
||||
loaderContext.emitError(new Error(`Unknown Sass implementation "${info}".`));
|
||||
return;
|
||||
}
|
||||
|
||||
const [implementationName, version] = infoParts;
|
||||
|
||||
if (implementationName === "dart-sass") {
|
||||
if (!_semver.default.satisfies(version, "^1.3.0")) {
|
||||
loaderContext.emitError(new Error(`Dart Sass version ${version} is incompatible with ^1.3.0.`));
|
||||
} // eslint-disable-next-line consistent-return
|
||||
|
||||
|
||||
return resolvedImplementation;
|
||||
} else if (implementationName === "node-sass") {
|
||||
if (!_semver.default.satisfies(version, "^4.0.0 || ^5.0.0 || ^6.0.0")) {
|
||||
loaderContext.emitError(new Error(`Node Sass version ${version} is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0.`));
|
||||
} // eslint-disable-next-line consistent-return
|
||||
|
||||
|
||||
return resolvedImplementation;
|
||||
}
|
||||
|
||||
loaderContext.emitError(new Error(`Unknown Sass implementation "${implementationName}".`));
|
||||
}
|
||||
|
||||
function isProductionLikeMode(loaderContext) {
|
||||
return loaderContext.mode === "production" || !loaderContext.mode;
|
||||
}
|
||||
|
||||
function proxyCustomImporters(importers, loaderContext) {
|
||||
return [].concat(importers).map(importer => function proxyImporter(...args) {
|
||||
this.webpackLoaderContext = loaderContext;
|
||||
return importer.apply(this, args);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Derives the sass options from the loader context and normalizes its values with sane defaults.
|
||||
*
|
||||
* @param {object} loaderContext
|
||||
* @param {object} loaderOptions
|
||||
* @param {string} content
|
||||
* @param {object} implementation
|
||||
* @param {boolean} useSourceMap
|
||||
* @returns {Object}
|
||||
*/
|
||||
|
||||
|
||||
async function getSassOptions(loaderContext, loaderOptions, content, implementation, useSourceMap) {
|
||||
const options = (0, _full.klona)(loaderOptions.sassOptions ? typeof loaderOptions.sassOptions === "function" ? loaderOptions.sassOptions(loaderContext) || {} : loaderOptions.sassOptions : {});
|
||||
const isDartSass = implementation.info.includes("dart-sass");
|
||||
|
||||
if (isDartSass) {
|
||||
const shouldTryToResolveFibers = !options.fiber && options.fiber !== false;
|
||||
|
||||
if (shouldTryToResolveFibers) {
|
||||
let fibers;
|
||||
|
||||
try {
|
||||
fibers = require.resolve("fibers");
|
||||
} catch (_error) {// Nothing
|
||||
}
|
||||
|
||||
if (fibers) {
|
||||
// eslint-disable-next-line global-require, import/no-dynamic-require
|
||||
options.fiber = require(fibers);
|
||||
}
|
||||
} else if (options.fiber === false) {
|
||||
// Don't pass the `fiber` option for `sass` (`Dart Sass`)
|
||||
delete options.fiber;
|
||||
}
|
||||
} else {
|
||||
// Don't pass the `fiber` option for `node-sass`
|
||||
delete options.fiber;
|
||||
}
|
||||
|
||||
options.file = loaderContext.resourcePath;
|
||||
options.data = loaderOptions.additionalData ? typeof loaderOptions.additionalData === "function" ? await loaderOptions.additionalData(content, loaderContext) : `${loaderOptions.additionalData}\n${content}` : content; // opt.outputStyle
|
||||
|
||||
if (!options.outputStyle && isProductionLikeMode(loaderContext)) {
|
||||
options.outputStyle = "compressed";
|
||||
}
|
||||
|
||||
if (useSourceMap) {
|
||||
// Deliberately overriding the sourceMap option here.
|
||||
// node-sass won't produce source maps if the data option is used and options.sourceMap is not a string.
|
||||
// In case it is a string, options.sourceMap should be a path where the source map is written.
|
||||
// But since we're using the data option, the source map will not actually be written, but
|
||||
// all paths in sourceMap.sources will be relative to that path.
|
||||
// Pretty complicated... :(
|
||||
options.sourceMap = true;
|
||||
options.outFile = _path.default.join(loaderContext.rootContext, "style.css.map");
|
||||
options.sourceMapContents = true;
|
||||
options.omitSourceMapUrl = true;
|
||||
options.sourceMapEmbed = false;
|
||||
}
|
||||
|
||||
const {
|
||||
resourcePath
|
||||
} = loaderContext;
|
||||
|
||||
const ext = _path.default.extname(resourcePath); // If we are compiling sass and indentedSyntax isn't set, automatically set it.
|
||||
|
||||
|
||||
if (ext && ext.toLowerCase() === ".sass" && typeof options.indentedSyntax === "undefined") {
|
||||
options.indentedSyntax = true;
|
||||
} else {
|
||||
options.indentedSyntax = Boolean(options.indentedSyntax);
|
||||
} // Allow passing custom importers to `sass`/`node-sass`. Accepts `Function` or an array of `Function`s.
|
||||
|
||||
|
||||
options.importer = options.importer ? proxyCustomImporters(Array.isArray(options.importer) ? options.importer : [options.importer], loaderContext) : [];
|
||||
options.includePaths = [].concat(process.cwd()).concat( // We use `includePaths` in context for resolver, so it should be always absolute
|
||||
(options.includePaths || []).map(includePath => _path.default.isAbsolute(includePath) ? includePath : _path.default.join(process.cwd(), includePath))).concat(process.env.SASS_PATH ? process.env.SASS_PATH.split(process.platform === "win32" ? ";" : ":") : []);
|
||||
return options;
|
||||
} // Examples:
|
||||
// - ~package
|
||||
// - ~package/
|
||||
// - ~@org
|
||||
// - ~@org/
|
||||
// - ~@org/package
|
||||
// - ~@org/package/
|
||||
|
||||
|
||||
const isModuleImport = /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;
|
||||
/**
|
||||
* When `sass`/`node-sass` tries to resolve an import, it uses a special algorithm.
|
||||
* Since the `sass-loader` uses webpack to resolve the modules, we need to simulate that algorithm.
|
||||
* This function returns an array of import paths to try.
|
||||
* The last entry in the array is always the original url to enable straight-forward webpack.config aliases.
|
||||
*
|
||||
* We don't need emulate `dart-sass` "It's not clear which file to import." errors (when "file.ext" and "_file.ext" files are present simultaneously in the same directory).
|
||||
* This reduces performance and `dart-sass` always do it on own side.
|
||||
*
|
||||
* @param {string} url
|
||||
* @param {boolean} forWebpackResolver
|
||||
* @param {string} rootContext
|
||||
* @returns {Array<string>}
|
||||
*/
|
||||
|
||||
function getPossibleRequests( // eslint-disable-next-line no-shadow
|
||||
url, forWebpackResolver = false, rootContext = false) {
|
||||
const request = (0, _loaderUtils.urlToRequest)(url, // Maybe it is server-relative URLs
|
||||
forWebpackResolver && rootContext); // In case there is module request, send this to webpack resolver
|
||||
|
||||
if (forWebpackResolver && isModuleImport.test(url)) {
|
||||
return [...new Set([request, url])];
|
||||
} // Keep in mind: ext can also be something like '.datepicker' when the true extension is omitted and the filename contains a dot.
|
||||
// @see https://github.com/webpack-contrib/sass-loader/issues/167
|
||||
|
||||
|
||||
const ext = _path.default.extname(request).toLowerCase(); // Because @import is also defined in CSS, Sass needs a way of compiling plain CSS @imports without trying to import the files at compile time.
|
||||
// To accomplish this, and to ensure SCSS is as much of a superset of CSS as possible, Sass will compile any @imports with the following characteristics to plain CSS imports:
|
||||
// - imports where the URL ends with .css.
|
||||
// - imports where the URL begins http:// or https://.
|
||||
// - imports where the URL is written as a url().
|
||||
// - imports that have media queries.
|
||||
//
|
||||
// The `node-sass` package sends `@import` ending on `.css` to importer, it is bug, so we skip resolve
|
||||
|
||||
|
||||
if (ext === ".css") {
|
||||
return [];
|
||||
}
|
||||
|
||||
const dirname = _path.default.dirname(request);
|
||||
|
||||
const basename = _path.default.basename(request);
|
||||
|
||||
return [...new Set([`${dirname}/_${basename}`, request].concat(forWebpackResolver ? [`${_path.default.dirname(url)}/_${basename}`, url] : []))];
|
||||
}
|
||||
|
||||
function promiseResolve(callbackResolve) {
|
||||
return (context, request) => new Promise((resolve, reject) => {
|
||||
callbackResolve(context, request, (error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const IS_SPECIAL_MODULE_IMPORT = /^~[^/]+$/; // `[drive_letter]:\` + `\\[server]\[sharename]\`
|
||||
|
||||
const IS_NATIVE_WIN32_PATH = /^[a-z]:[/\\]|^\\\\/i;
|
||||
/**
|
||||
* @public
|
||||
* Create the resolve function used in the custom Sass importer.
|
||||
*
|
||||
* Can be used by external tools to mimic how `sass-loader` works, for example
|
||||
* in a Jest transform. Such usages will want to wrap `resolve.create` from
|
||||
* [`enhanced-resolve`]{@link https://github.com/webpack/enhanced-resolve} to
|
||||
* pass as the `resolverFactory` argument.
|
||||
*
|
||||
* @param {Function} resolverFactory - A factory function for creating a Webpack
|
||||
* resolver.
|
||||
* @param {Object} implementation - The imported Sass implementation, both
|
||||
* `sass` (Dart Sass) and `node-sass` are supported.
|
||||
* @param {string[]} [includePaths] - The list of include paths passed to Sass.
|
||||
* @param {boolean} [rootContext] - The configured Webpack root context.
|
||||
*
|
||||
* @throws If a compatible Sass implementation cannot be found.
|
||||
*/
|
||||
|
||||
function getWebpackResolver(resolverFactory, implementation, includePaths = [], rootContext = false) {
|
||||
async function startResolving(resolutionMap) {
|
||||
if (resolutionMap.length === 0) {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const [{
|
||||
possibleRequests
|
||||
}] = resolutionMap;
|
||||
|
||||
if (possibleRequests.length === 0) {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
const [{
|
||||
resolve,
|
||||
context
|
||||
}] = resolutionMap;
|
||||
|
||||
try {
|
||||
return await resolve(context, possibleRequests[0]);
|
||||
} catch (_ignoreError) {
|
||||
const [, ...tailResult] = possibleRequests;
|
||||
|
||||
if (tailResult.length === 0) {
|
||||
const [, ...tailResolutionMap] = resolutionMap;
|
||||
return startResolving(tailResolutionMap);
|
||||
} // eslint-disable-next-line no-param-reassign
|
||||
|
||||
|
||||
resolutionMap[0].possibleRequests = tailResult;
|
||||
return startResolving(resolutionMap);
|
||||
}
|
||||
}
|
||||
|
||||
const isDartSass = implementation.info.includes("dart-sass");
|
||||
const sassResolve = promiseResolve(resolverFactory({
|
||||
alias: [],
|
||||
aliasFields: [],
|
||||
conditionNames: [],
|
||||
descriptionFiles: [],
|
||||
extensions: [".sass", ".scss", ".css"],
|
||||
exportsFields: [],
|
||||
mainFields: [],
|
||||
mainFiles: ["_index", "index"],
|
||||
modules: [],
|
||||
restrictions: [/\.((sa|sc|c)ss)$/i]
|
||||
}));
|
||||
const webpackResolve = promiseResolve(resolverFactory({
|
||||
conditionNames: ["sass", "style"],
|
||||
mainFields: ["sass", "style", "main", "..."],
|
||||
mainFiles: ["_index", "index", "..."],
|
||||
extensions: [".sass", ".scss", ".css"],
|
||||
restrictions: [/\.((sa|sc|c)ss)$/i]
|
||||
}));
|
||||
return (context, request) => {
|
||||
const originalRequest = request;
|
||||
const isFileScheme = originalRequest.slice(0, 5).toLowerCase() === "file:";
|
||||
|
||||
if (isFileScheme) {
|
||||
try {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
request = _url.default.fileURLToPath(originalRequest);
|
||||
} catch (ignoreError) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
request = request.slice(7);
|
||||
}
|
||||
}
|
||||
|
||||
let resolutionMap = [];
|
||||
const needEmulateSassResolver = // `sass` doesn't support module import
|
||||
!IS_SPECIAL_MODULE_IMPORT.test(request) && // We need improve absolute paths handling.
|
||||
// Absolute paths should be resolved:
|
||||
// - Server-relative URLs - `<context>/path/to/file.ext` (where `<context>` is root context)
|
||||
// - Absolute path - `/full/path/to/file.ext` or `C:\\full\path\to\file.ext`
|
||||
!isFileScheme && !originalRequest.startsWith("/") && !IS_NATIVE_WIN32_PATH.test(originalRequest);
|
||||
|
||||
if (includePaths.length > 0 && needEmulateSassResolver) {
|
||||
// The order of import precedence is as follows:
|
||||
//
|
||||
// 1. Filesystem imports relative to the base file.
|
||||
// 2. Custom importer imports.
|
||||
// 3. Filesystem imports relative to the working directory.
|
||||
// 4. Filesystem imports relative to an `includePaths` path.
|
||||
// 5. Filesystem imports relative to a `SASS_PATH` path.
|
||||
//
|
||||
// Because `sass`/`node-sass` run custom importers before `3`, `4` and `5` points, we need to emulate this behavior to avoid wrong resolution.
|
||||
const sassPossibleRequests = getPossibleRequests(request); // `node-sass` calls our importer before `1. Filesystem imports relative to the base file.`, so we need emulate this too
|
||||
|
||||
if (!isDartSass) {
|
||||
resolutionMap = resolutionMap.concat({
|
||||
resolve: sassResolve,
|
||||
context: _path.default.dirname(context),
|
||||
possibleRequests: sassPossibleRequests
|
||||
});
|
||||
}
|
||||
|
||||
resolutionMap = resolutionMap.concat( // eslint-disable-next-line no-shadow
|
||||
includePaths.map(context => {
|
||||
return {
|
||||
resolve: sassResolve,
|
||||
context,
|
||||
possibleRequests: sassPossibleRequests
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
const webpackPossibleRequests = getPossibleRequests(request, true, rootContext);
|
||||
resolutionMap = resolutionMap.concat({
|
||||
resolve: webpackResolve,
|
||||
context: _path.default.dirname(context),
|
||||
possibleRequests: webpackPossibleRequests
|
||||
});
|
||||
return startResolving(resolutionMap);
|
||||
};
|
||||
}
|
||||
|
||||
const matchCss = /\.css$/i;
|
||||
|
||||
function getWebpackImporter(loaderContext, implementation, includePaths) {
|
||||
const resolve = getWebpackResolver(loaderContext.getResolve, implementation, includePaths, loaderContext.rootContext);
|
||||
return (originalUrl, prev, done) => {
|
||||
resolve(prev, originalUrl).then(result => {
|
||||
// Add the result as dependency.
|
||||
// Although we're also using stats.includedFiles, this might come in handy when an error occurs.
|
||||
// In this case, we don't get stats.includedFiles from node-sass/sass.
|
||||
loaderContext.addDependency(_path.default.normalize(result)); // By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it.
|
||||
|
||||
done({
|
||||
file: result.replace(matchCss, "")
|
||||
});
|
||||
}) // Catch all resolving errors, return the original file and pass responsibility back to other custom importers
|
||||
.catch(() => {
|
||||
done({
|
||||
file: originalUrl
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
let nodeSassJobQueue = null;
|
||||
/**
|
||||
* Verifies that the implementation and version of Sass is supported by this loader.
|
||||
*
|
||||
* @param {Object} implementation
|
||||
* @returns {Function}
|
||||
*/
|
||||
|
||||
function getRenderFunctionFromSassImplementation(implementation) {
|
||||
const isDartSass = implementation.info.includes("dart-sass");
|
||||
|
||||
if (isDartSass) {
|
||||
return implementation.render.bind(implementation);
|
||||
} // There is an issue with node-sass when async custom importers are used
|
||||
// See https://github.com/sass/node-sass/issues/857#issuecomment-93594360
|
||||
// We need to use a job queue to make sure that one thread is always available to the UV lib
|
||||
|
||||
|
||||
if (nodeSassJobQueue === null) {
|
||||
const threadPoolSize = Number(process.env.UV_THREADPOOL_SIZE || 4);
|
||||
nodeSassJobQueue = _neoAsync.default.queue(implementation.render.bind(implementation), threadPoolSize - 1);
|
||||
}
|
||||
|
||||
return nodeSassJobQueue.push.bind(nodeSassJobQueue);
|
||||
}
|
||||
|
||||
const ABSOLUTE_SCHEME = /^[A-Za-z0-9+\-.]+:/;
|
||||
|
||||
function getURLType(source) {
|
||||
if (source[0] === "/") {
|
||||
if (source[1] === "/") {
|
||||
return "scheme-relative";
|
||||
}
|
||||
|
||||
return "path-absolute";
|
||||
}
|
||||
|
||||
if (IS_NATIVE_WIN32_PATH.test(source)) {
|
||||
return "path-absolute";
|
||||
}
|
||||
|
||||
return ABSOLUTE_SCHEME.test(source) ? "absolute" : "path-relative";
|
||||
}
|
||||
|
||||
function normalizeSourceMap(map, rootContext) {
|
||||
const newMap = map; // result.map.file is an optional property that provides the output filename.
|
||||
// Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it.
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
||||
delete newMap.file; // eslint-disable-next-line no-param-reassign
|
||||
|
||||
newMap.sourceRoot = ""; // node-sass returns POSIX paths, that's why we need to transform them back to native paths.
|
||||
// This fixes an error on windows where the source-map module cannot resolve the source maps.
|
||||
// @see https://github.com/webpack-contrib/sass-loader/issues/366#issuecomment-279460722
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
|
||||
newMap.sources = newMap.sources.map(source => {
|
||||
const sourceType = getURLType(source); // Do no touch `scheme-relative`, `path-absolute` and `absolute` types
|
||||
|
||||
if (sourceType === "path-relative") {
|
||||
return _path.default.resolve(rootContext, _path.default.normalize(source));
|
||||
}
|
||||
|
||||
return source;
|
||||
});
|
||||
return newMap;
|
||||
}
|
20
web/node_modules/sass-loader/node_modules/schema-utils/LICENSE
generated
vendored
Normal file
20
web/node_modules/sass-loader/node_modules/schema-utils/LICENSE
generated
vendored
Normal file
|
@ -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.
|
290
web/node_modules/sass-loader/node_modules/schema-utils/README.md
generated
vendored
Normal file
290
web/node_modules/sass-loader/node_modules/schema-utils/README.md
generated
vendored
Normal file
|
@ -0,0 +1,290 @@
|
|||
<div align="center">
|
||||
<a href="http://json-schema.org">
|
||||
<img width="160" height="160"
|
||||
src="https://raw.githubusercontent.com/webpack-contrib/schema-utils/master/.github/assets/logo.png">
|
||||
</a>
|
||||
<a href="https://github.com/webpack/webpack">
|
||||
<img width="200" height="200"
|
||||
src="https://webpack.js.org/assets/icon-square-big.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
[![npm][npm]][npm-url]
|
||||
[![node][node]][node-url]
|
||||
[![deps][deps]][deps-url]
|
||||
[![tests][tests]][tests-url]
|
||||
[![coverage][cover]][cover-url]
|
||||
[![chat][chat]][chat-url]
|
||||
[![size][size]][size-url]
|
||||
|
||||
# schema-utils
|
||||
|
||||
Package for validate options in loaders and plugins.
|
||||
|
||||
## Getting Started
|
||||
|
||||
To begin, you'll need to install `schema-utils`:
|
||||
|
||||
```console
|
||||
npm install schema-utils
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
**schema.json**
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"option": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
import schema from "./path/to/schema.json";
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
const options = { option: true };
|
||||
const configuration = { name: "Loader Name/Plugin Name/Name" };
|
||||
|
||||
validate(schema, options, configuration);
|
||||
```
|
||||
|
||||
### `schema`
|
||||
|
||||
Type: `String`
|
||||
|
||||
JSON schema.
|
||||
|
||||
Simple example of schema:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "This is description of option.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
```
|
||||
|
||||
### `options`
|
||||
|
||||
Type: `Object`
|
||||
|
||||
Object with options.
|
||||
|
||||
```js
|
||||
import schema from "./path/to/schema.json";
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
const options = { foo: "bar" };
|
||||
|
||||
validate(schema, { name: 123 }, { name: "MyPlugin" });
|
||||
```
|
||||
|
||||
### `configuration`
|
||||
|
||||
Allow to configure validator.
|
||||
|
||||
There is an alternative method to configure the `name` and`baseDataPath` options via the `title` property in the schema.
|
||||
For example:
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "My Loader options",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "This is description of option.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
```
|
||||
|
||||
The last word used for the `baseDataPath` option, other words used for the `name` option.
|
||||
Based on the example above the `name` option equals `My Loader`, the `baseDataPath` option equals `options`.
|
||||
|
||||
#### `name`
|
||||
|
||||
Type: `Object`
|
||||
Default: `"Object"`
|
||||
|
||||
Allow to setup name in validation errors.
|
||||
|
||||
```js
|
||||
import schema from "./path/to/schema.json";
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
const options = { foo: "bar" };
|
||||
|
||||
validate(schema, options, { name: "MyPlugin" });
|
||||
```
|
||||
|
||||
```shell
|
||||
Invalid configuration object. MyPlugin has been initialised using a configuration object that does not match the API schema.
|
||||
- configuration.optionName should be a integer.
|
||||
```
|
||||
|
||||
#### `baseDataPath`
|
||||
|
||||
Type: `String`
|
||||
Default: `"configuration"`
|
||||
|
||||
Allow to setup base data path in validation errors.
|
||||
|
||||
```js
|
||||
import schema from "./path/to/schema.json";
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
const options = { foo: "bar" };
|
||||
|
||||
validate(schema, options, { name: "MyPlugin", baseDataPath: "options" });
|
||||
```
|
||||
|
||||
```shell
|
||||
Invalid options object. MyPlugin has been initialised using an options object that does not match the API schema.
|
||||
- options.optionName should be a integer.
|
||||
```
|
||||
|
||||
#### `postFormatter`
|
||||
|
||||
Type: `Function`
|
||||
Default: `undefined`
|
||||
|
||||
Allow to reformat errors.
|
||||
|
||||
```js
|
||||
import schema from "./path/to/schema.json";
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
const options = { foo: "bar" };
|
||||
|
||||
validate(schema, options, {
|
||||
name: "MyPlugin",
|
||||
postFormatter: (formattedError, error) => {
|
||||
if (error.keyword === "type") {
|
||||
return `${formattedError}\nAdditional Information.`;
|
||||
}
|
||||
|
||||
return formattedError;
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
```shell
|
||||
Invalid options object. MyPlugin has been initialized using an options object that does not match the API schema.
|
||||
- options.optionName should be a integer.
|
||||
Additional Information.
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
**schema.json**
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"test": {
|
||||
"anyOf": [
|
||||
{ "type": "array" },
|
||||
{ "type": "string" },
|
||||
{ "instanceof": "RegExp" }
|
||||
]
|
||||
},
|
||||
"transform": {
|
||||
"instanceof": "Function"
|
||||
},
|
||||
"sourceMap": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
```
|
||||
|
||||
### `Loader`
|
||||
|
||||
```js
|
||||
import { getOptions } from "loader-utils";
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
import schema from "path/to/schema.json";
|
||||
|
||||
function loader(src, map) {
|
||||
const options = getOptions(this);
|
||||
|
||||
validate(schema, options, {
|
||||
name: "Loader Name",
|
||||
baseDataPath: "options",
|
||||
});
|
||||
|
||||
// Code...
|
||||
}
|
||||
|
||||
export default loader;
|
||||
```
|
||||
|
||||
### `Plugin`
|
||||
|
||||
```js
|
||||
import { validate } from "schema-utils";
|
||||
|
||||
import schema from "path/to/schema.json";
|
||||
|
||||
class Plugin {
|
||||
constructor(options) {
|
||||
validate(schema, options, {
|
||||
name: "Plugin Name",
|
||||
baseDataPath: "options",
|
||||
});
|
||||
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
// Code...
|
||||
}
|
||||
}
|
||||
|
||||
export default Plugin;
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Please take a moment to read our contributing guidelines if you haven't yet done so.
|
||||
|
||||
[CONTRIBUTING](./.github/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/schema-utils.svg
|
||||
[npm-url]: https://npmjs.com/package/schema-utils
|
||||
[node]: https://img.shields.io/node/v/schema-utils.svg
|
||||
[node-url]: https://nodejs.org
|
||||
[deps]: https://david-dm.org/webpack/schema-utils.svg
|
||||
[deps-url]: https://david-dm.org/webpack/schema-utils
|
||||
[tests]: https://github.com/webpack/schema-utils/workflows/schema-utils/badge.svg
|
||||
[tests-url]: https://github.com/webpack/schema-utils/actions
|
||||
[cover]: https://codecov.io/gh/webpack/schema-utils/branch/master/graph/badge.svg
|
||||
[cover-url]: https://codecov.io/gh/webpack/schema-utils
|
||||
[chat]: https://badges.gitter.im/webpack/webpack.svg
|
||||
[chat-url]: https://gitter.im/webpack/webpack
|
||||
[size]: https://packagephobia.com/badge?p=schema-utils
|
||||
[size-url]: https://packagephobia.com/result?p=schema-utils
|
74
web/node_modules/sass-loader/node_modules/schema-utils/declarations/ValidationError.d.ts
generated
vendored
Normal file
74
web/node_modules/sass-loader/node_modules/schema-utils/declarations/ValidationError.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,74 @@
|
|||
export default ValidationError;
|
||||
export type JSONSchema6 = import("json-schema").JSONSchema6;
|
||||
export type JSONSchema7 = import("json-schema").JSONSchema7;
|
||||
export type Schema = import("./validate").Schema;
|
||||
export type ValidationErrorConfiguration =
|
||||
import("./validate").ValidationErrorConfiguration;
|
||||
export type PostFormatter = import("./validate").PostFormatter;
|
||||
export type SchemaUtilErrorObject = import("./validate").SchemaUtilErrorObject;
|
||||
declare class ValidationError extends Error {
|
||||
/**
|
||||
* @param {Array<SchemaUtilErrorObject>} errors
|
||||
* @param {Schema} schema
|
||||
* @param {ValidationErrorConfiguration} configuration
|
||||
*/
|
||||
constructor(
|
||||
errors: Array<SchemaUtilErrorObject>,
|
||||
schema: Schema,
|
||||
configuration?: ValidationErrorConfiguration
|
||||
);
|
||||
/** @type {Array<SchemaUtilErrorObject>} */
|
||||
errors: Array<SchemaUtilErrorObject>;
|
||||
/** @type {Schema} */
|
||||
schema: Schema;
|
||||
/** @type {string} */
|
||||
headerName: string;
|
||||
/** @type {string} */
|
||||
baseDataPath: string;
|
||||
/** @type {PostFormatter | null} */
|
||||
postFormatter: PostFormatter | null;
|
||||
/**
|
||||
* @param {string} path
|
||||
* @returns {Schema}
|
||||
*/
|
||||
getSchemaPart(path: string): Schema;
|
||||
/**
|
||||
* @param {Schema} schema
|
||||
* @param {boolean} logic
|
||||
* @param {Array<Object>} prevSchemas
|
||||
* @returns {string}
|
||||
*/
|
||||
formatSchema(
|
||||
schema: Schema,
|
||||
logic?: boolean,
|
||||
prevSchemas?: Array<Object>
|
||||
): string;
|
||||
/**
|
||||
* @param {Schema=} schemaPart
|
||||
* @param {(boolean | Array<string>)=} additionalPath
|
||||
* @param {boolean=} needDot
|
||||
* @param {boolean=} logic
|
||||
* @returns {string}
|
||||
*/
|
||||
getSchemaPartText(
|
||||
schemaPart?: Schema | undefined,
|
||||
additionalPath?: (boolean | Array<string>) | undefined,
|
||||
needDot?: boolean | undefined,
|
||||
logic?: boolean | undefined
|
||||
): string;
|
||||
/**
|
||||
* @param {Schema=} schemaPart
|
||||
* @returns {string}
|
||||
*/
|
||||
getSchemaPartDescription(schemaPart?: Schema | undefined): string;
|
||||
/**
|
||||
* @param {SchemaUtilErrorObject} error
|
||||
* @returns {string}
|
||||
*/
|
||||
formatValidationError(error: SchemaUtilErrorObject): string;
|
||||
/**
|
||||
* @param {Array<SchemaUtilErrorObject>} errors
|
||||
* @returns {string}
|
||||
*/
|
||||
formatValidationErrors(errors: Array<SchemaUtilErrorObject>): string;
|
||||
}
|
3
web/node_modules/sass-loader/node_modules/schema-utils/declarations/index.d.ts
generated
vendored
Normal file
3
web/node_modules/sass-loader/node_modules/schema-utils/declarations/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { validate } from "./validate";
|
||||
import { ValidationError } from "./validate";
|
||||
export { validate, ValidationError };
|
10
web/node_modules/sass-loader/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts
generated
vendored
Normal file
10
web/node_modules/sass-loader/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
export default addAbsolutePathKeyword;
|
||||
export type Ajv = import("ajv").Ajv;
|
||||
export type ValidateFunction = import("ajv").ValidateFunction;
|
||||
export type SchemaUtilErrorObject = import("../validate").SchemaUtilErrorObject;
|
||||
/**
|
||||
*
|
||||
* @param {Ajv} ajv
|
||||
* @returns {Ajv}
|
||||
*/
|
||||
declare function addAbsolutePathKeyword(ajv: Ajv): Ajv;
|
79
web/node_modules/sass-loader/node_modules/schema-utils/declarations/util/Range.d.ts
generated
vendored
Normal file
79
web/node_modules/sass-loader/node_modules/schema-utils/declarations/util/Range.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
export = Range;
|
||||
/**
|
||||
* @typedef {[number, boolean]} RangeValue
|
||||
*/
|
||||
/**
|
||||
* @callback RangeValueCallback
|
||||
* @param {RangeValue} rangeValue
|
||||
* @returns {boolean}
|
||||
*/
|
||||
declare class Range {
|
||||
/**
|
||||
* @param {"left" | "right"} side
|
||||
* @param {boolean} exclusive
|
||||
* @returns {">" | ">=" | "<" | "<="}
|
||||
*/
|
||||
static getOperator(
|
||||
side: "left" | "right",
|
||||
exclusive: boolean
|
||||
): ">" | ">=" | "<" | "<=";
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @param {boolean} exclusive is range exclusive
|
||||
* @returns {string}
|
||||
*/
|
||||
static formatRight(value: number, logic: boolean, exclusive: boolean): string;
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @param {boolean} exclusive is range exclusive
|
||||
* @returns {string}
|
||||
*/
|
||||
static formatLeft(value: number, logic: boolean, exclusive: boolean): string;
|
||||
/**
|
||||
* @param {number} start left side value
|
||||
* @param {number} end right side value
|
||||
* @param {boolean} startExclusive is range exclusive from left side
|
||||
* @param {boolean} endExclusive is range exclusive from right side
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @returns {string}
|
||||
*/
|
||||
static formatRange(
|
||||
start: number,
|
||||
end: number,
|
||||
startExclusive: boolean,
|
||||
endExclusive: boolean,
|
||||
logic: boolean
|
||||
): string;
|
||||
/**
|
||||
* @param {Array<RangeValue>} values
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @return {RangeValue} computed value and it's exclusive flag
|
||||
*/
|
||||
static getRangeValue(values: Array<RangeValue>, logic: boolean): RangeValue;
|
||||
/** @type {Array<RangeValue>} */
|
||||
_left: Array<RangeValue>;
|
||||
/** @type {Array<RangeValue>} */
|
||||
_right: Array<RangeValue>;
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean=} exclusive
|
||||
*/
|
||||
left(value: number, exclusive?: boolean | undefined): void;
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean=} exclusive
|
||||
*/
|
||||
right(value: number, exclusive?: boolean | undefined): void;
|
||||
/**
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @return {string} "smart" range string representation
|
||||
*/
|
||||
format(logic?: boolean): string;
|
||||
}
|
||||
declare namespace Range {
|
||||
export { RangeValue, RangeValueCallback };
|
||||
}
|
||||
type RangeValue = [number, boolean];
|
||||
type RangeValueCallback = (rangeValue: RangeValue) => boolean;
|
3
web/node_modules/sass-loader/node_modules/schema-utils/declarations/util/hints.d.ts
generated
vendored
Normal file
3
web/node_modules/sass-loader/node_modules/schema-utils/declarations/util/hints.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
export function stringHints(schema: Schema, logic: boolean): string[];
|
||||
export function numberHints(schema: Schema, logic: boolean): string[];
|
||||
export type Schema = import("../validate").Schema;
|
37
web/node_modules/sass-loader/node_modules/schema-utils/declarations/validate.d.ts
generated
vendored
Normal file
37
web/node_modules/sass-loader/node_modules/schema-utils/declarations/validate.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
export type JSONSchema4 = import("json-schema").JSONSchema4;
|
||||
export type JSONSchema6 = import("json-schema").JSONSchema6;
|
||||
export type JSONSchema7 = import("json-schema").JSONSchema7;
|
||||
export type ErrorObject = import("ajv").ErrorObject;
|
||||
export type Extend = {
|
||||
formatMinimum?: number | undefined;
|
||||
formatMaximum?: number | undefined;
|
||||
formatExclusiveMinimum?: boolean | undefined;
|
||||
formatExclusiveMaximum?: boolean | undefined;
|
||||
link?: string | undefined;
|
||||
};
|
||||
export type Schema = (JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend;
|
||||
export type SchemaUtilErrorObject = ErrorObject & {
|
||||
children?: Array<ErrorObject>;
|
||||
};
|
||||
export type PostFormatter = (
|
||||
formattedError: string,
|
||||
error: SchemaUtilErrorObject
|
||||
) => string;
|
||||
export type ValidationErrorConfiguration = {
|
||||
name?: string | undefined;
|
||||
baseDataPath?: string | undefined;
|
||||
postFormatter?: PostFormatter | undefined;
|
||||
};
|
||||
/**
|
||||
* @param {Schema} schema
|
||||
* @param {Array<object> | object} options
|
||||
* @param {ValidationErrorConfiguration=} configuration
|
||||
* @returns {void}
|
||||
*/
|
||||
export function validate(
|
||||
schema: Schema,
|
||||
options: Array<object> | object,
|
||||
configuration?: ValidationErrorConfiguration | undefined
|
||||
): void;
|
||||
import ValidationError from "./ValidationError";
|
||||
export { ValidationError };
|
1271
web/node_modules/sass-loader/node_modules/schema-utils/dist/ValidationError.js
generated
vendored
Normal file
1271
web/node_modules/sass-loader/node_modules/schema-utils/dist/ValidationError.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
11
web/node_modules/sass-loader/node_modules/schema-utils/dist/index.js
generated
vendored
Normal file
11
web/node_modules/sass-loader/node_modules/schema-utils/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
const {
|
||||
validate,
|
||||
ValidationError
|
||||
} = require("./validate");
|
||||
|
||||
module.exports = {
|
||||
validate,
|
||||
ValidationError
|
||||
};
|
93
web/node_modules/sass-loader/node_modules/schema-utils/dist/keywords/absolutePath.js
generated
vendored
Normal file
93
web/node_modules/sass-loader/node_modules/schema-utils/dist/keywords/absolutePath.js
generated
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/** @typedef {import("ajv").Ajv} Ajv */
|
||||
|
||||
/** @typedef {import("ajv").ValidateFunction} ValidateFunction */
|
||||
|
||||
/** @typedef {import("../validate").SchemaUtilErrorObject} SchemaUtilErrorObject */
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {object} schema
|
||||
* @param {string} data
|
||||
* @returns {SchemaUtilErrorObject}
|
||||
*/
|
||||
function errorMessage(message, schema, data) {
|
||||
return {
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line no-undefined
|
||||
dataPath: undefined,
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line no-undefined
|
||||
schemaPath: undefined,
|
||||
keyword: "absolutePath",
|
||||
params: {
|
||||
absolutePath: data
|
||||
},
|
||||
message,
|
||||
parentSchema: schema
|
||||
};
|
||||
}
|
||||
/**
|
||||
* @param {boolean} shouldBeAbsolute
|
||||
* @param {object} schema
|
||||
* @param {string} data
|
||||
* @returns {SchemaUtilErrorObject}
|
||||
*/
|
||||
|
||||
|
||||
function getErrorFor(shouldBeAbsolute, schema, data) {
|
||||
const message = shouldBeAbsolute ? `The provided value ${JSON.stringify(data)} is not an absolute path!` : `A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`;
|
||||
return errorMessage(message, schema, data);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {Ajv} ajv
|
||||
* @returns {Ajv}
|
||||
*/
|
||||
|
||||
|
||||
function addAbsolutePathKeyword(ajv) {
|
||||
ajv.addKeyword("absolutePath", {
|
||||
errors: true,
|
||||
type: "string",
|
||||
|
||||
compile(schema, parentSchema) {
|
||||
/** @type {ValidateFunction} */
|
||||
const callback = data => {
|
||||
let passes = true;
|
||||
const isExclamationMarkPresent = data.includes("!");
|
||||
|
||||
if (isExclamationMarkPresent) {
|
||||
callback.errors = [errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`, parentSchema, data)];
|
||||
passes = false;
|
||||
} // ?:[A-Za-z]:\\ - Windows absolute path
|
||||
// \\\\ - Windows network absolute path
|
||||
// \/ - Unix-like OS absolute path
|
||||
|
||||
|
||||
const isCorrectAbsolutePath = schema === /^(?:[A-Za-z]:(\\|\/)|\\\\|\/)/.test(data);
|
||||
|
||||
if (!isCorrectAbsolutePath) {
|
||||
callback.errors = [getErrorFor(schema, parentSchema, data)];
|
||||
passes = false;
|
||||
}
|
||||
|
||||
return passes;
|
||||
};
|
||||
|
||||
callback.errors = [];
|
||||
return callback;
|
||||
}
|
||||
|
||||
});
|
||||
return ajv;
|
||||
}
|
||||
|
||||
var _default = addAbsolutePathKeyword;
|
||||
exports.default = _default;
|
163
web/node_modules/sass-loader/node_modules/schema-utils/dist/util/Range.js
generated
vendored
Normal file
163
web/node_modules/sass-loader/node_modules/schema-utils/dist/util/Range.js
generated
vendored
Normal file
|
@ -0,0 +1,163 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* @typedef {[number, boolean]} RangeValue
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback RangeValueCallback
|
||||
* @param {RangeValue} rangeValue
|
||||
* @returns {boolean}
|
||||
*/
|
||||
class Range {
|
||||
/**
|
||||
* @param {"left" | "right"} side
|
||||
* @param {boolean} exclusive
|
||||
* @returns {">" | ">=" | "<" | "<="}
|
||||
*/
|
||||
static getOperator(side, exclusive) {
|
||||
if (side === "left") {
|
||||
return exclusive ? ">" : ">=";
|
||||
}
|
||||
|
||||
return exclusive ? "<" : "<=";
|
||||
}
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @param {boolean} exclusive is range exclusive
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
|
||||
static formatRight(value, logic, exclusive) {
|
||||
if (logic === false) {
|
||||
return Range.formatLeft(value, !logic, !exclusive);
|
||||
}
|
||||
|
||||
return `should be ${Range.getOperator("right", exclusive)} ${value}`;
|
||||
}
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @param {boolean} exclusive is range exclusive
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
|
||||
static formatLeft(value, logic, exclusive) {
|
||||
if (logic === false) {
|
||||
return Range.formatRight(value, !logic, !exclusive);
|
||||
}
|
||||
|
||||
return `should be ${Range.getOperator("left", exclusive)} ${value}`;
|
||||
}
|
||||
/**
|
||||
* @param {number} start left side value
|
||||
* @param {number} end right side value
|
||||
* @param {boolean} startExclusive is range exclusive from left side
|
||||
* @param {boolean} endExclusive is range exclusive from right side
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
|
||||
static formatRange(start, end, startExclusive, endExclusive, logic) {
|
||||
let result = "should be";
|
||||
result += ` ${Range.getOperator(logic ? "left" : "right", logic ? startExclusive : !startExclusive)} ${start} `;
|
||||
result += logic ? "and" : "or";
|
||||
result += ` ${Range.getOperator(logic ? "right" : "left", logic ? endExclusive : !endExclusive)} ${end}`;
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @param {Array<RangeValue>} values
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @return {RangeValue} computed value and it's exclusive flag
|
||||
*/
|
||||
|
||||
|
||||
static getRangeValue(values, logic) {
|
||||
let minMax = logic ? Infinity : -Infinity;
|
||||
let j = -1;
|
||||
const predicate = logic ?
|
||||
/** @type {RangeValueCallback} */
|
||||
([value]) => value <= minMax :
|
||||
/** @type {RangeValueCallback} */
|
||||
([value]) => value >= minMax;
|
||||
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
if (predicate(values[i])) {
|
||||
[minMax] = values[i];
|
||||
j = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (j > -1) {
|
||||
return values[j];
|
||||
}
|
||||
|
||||
return [Infinity, true];
|
||||
}
|
||||
|
||||
constructor() {
|
||||
/** @type {Array<RangeValue>} */
|
||||
this._left = [];
|
||||
/** @type {Array<RangeValue>} */
|
||||
|
||||
this._right = [];
|
||||
}
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean=} exclusive
|
||||
*/
|
||||
|
||||
|
||||
left(value, exclusive = false) {
|
||||
this._left.push([value, exclusive]);
|
||||
}
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {boolean=} exclusive
|
||||
*/
|
||||
|
||||
|
||||
right(value, exclusive = false) {
|
||||
this._right.push([value, exclusive]);
|
||||
}
|
||||
/**
|
||||
* @param {boolean} logic is not logic applied
|
||||
* @return {string} "smart" range string representation
|
||||
*/
|
||||
|
||||
|
||||
format(logic = true) {
|
||||
const [start, leftExclusive] = Range.getRangeValue(this._left, logic);
|
||||
const [end, rightExclusive] = Range.getRangeValue(this._right, !logic);
|
||||
|
||||
if (!Number.isFinite(start) && !Number.isFinite(end)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const realStart = leftExclusive ? start + 1 : start;
|
||||
const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6
|
||||
|
||||
if (realStart === realEnd) {
|
||||
return `should be ${logic ? "" : "!"}= ${realStart}`;
|
||||
} // e.g. 4 < x < ∞
|
||||
|
||||
|
||||
if (Number.isFinite(start) && !Number.isFinite(end)) {
|
||||
return Range.formatLeft(start, logic, leftExclusive);
|
||||
} // e.g. ∞ < x < 4
|
||||
|
||||
|
||||
if (!Number.isFinite(start) && Number.isFinite(end)) {
|
||||
return Range.formatRight(end, logic, rightExclusive);
|
||||
}
|
||||
|
||||
return Range.formatRange(start, end, leftExclusive, rightExclusive, logic);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Range;
|
105
web/node_modules/sass-loader/node_modules/schema-utils/dist/util/hints.js
generated
vendored
Normal file
105
web/node_modules/sass-loader/node_modules/schema-utils/dist/util/hints.js
generated
vendored
Normal file
|
@ -0,0 +1,105 @@
|
|||
"use strict";
|
||||
|
||||
const Range = require("./Range");
|
||||
/** @typedef {import("../validate").Schema} Schema */
|
||||
|
||||
/**
|
||||
* @param {Schema} schema
|
||||
* @param {boolean} logic
|
||||
* @return {string[]}
|
||||
*/
|
||||
|
||||
|
||||
module.exports.stringHints = function stringHints(schema, logic) {
|
||||
const hints = [];
|
||||
let type = "string";
|
||||
const currentSchema = { ...schema
|
||||
};
|
||||
|
||||
if (!logic) {
|
||||
const tmpLength = currentSchema.minLength;
|
||||
const tmpFormat = currentSchema.formatMinimum;
|
||||
const tmpExclusive = currentSchema.formatExclusiveMaximum;
|
||||
currentSchema.minLength = currentSchema.maxLength;
|
||||
currentSchema.maxLength = tmpLength;
|
||||
currentSchema.formatMinimum = currentSchema.formatMaximum;
|
||||
currentSchema.formatMaximum = tmpFormat;
|
||||
currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum;
|
||||
currentSchema.formatExclusiveMinimum = !tmpExclusive;
|
||||
}
|
||||
|
||||
if (typeof currentSchema.minLength === "number") {
|
||||
if (currentSchema.minLength === 1) {
|
||||
type = "non-empty string";
|
||||
} else {
|
||||
const length = Math.max(currentSchema.minLength - 1, 0);
|
||||
hints.push(`should be longer than ${length} character${length > 1 ? "s" : ""}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof currentSchema.maxLength === "number") {
|
||||
if (currentSchema.maxLength === 0) {
|
||||
type = "empty string";
|
||||
} else {
|
||||
const length = currentSchema.maxLength + 1;
|
||||
hints.push(`should be shorter than ${length} character${length > 1 ? "s" : ""}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentSchema.pattern) {
|
||||
hints.push(`should${logic ? "" : " not"} match pattern ${JSON.stringify(currentSchema.pattern)}`);
|
||||
}
|
||||
|
||||
if (currentSchema.format) {
|
||||
hints.push(`should${logic ? "" : " not"} match format ${JSON.stringify(currentSchema.format)}`);
|
||||
}
|
||||
|
||||
if (currentSchema.formatMinimum) {
|
||||
hints.push(`should be ${currentSchema.formatExclusiveMinimum ? ">" : ">="} ${JSON.stringify(currentSchema.formatMinimum)}`);
|
||||
}
|
||||
|
||||
if (currentSchema.formatMaximum) {
|
||||
hints.push(`should be ${currentSchema.formatExclusiveMaximum ? "<" : "<="} ${JSON.stringify(currentSchema.formatMaximum)}`);
|
||||
}
|
||||
|
||||
return [type].concat(hints);
|
||||
};
|
||||
/**
|
||||
* @param {Schema} schema
|
||||
* @param {boolean} logic
|
||||
* @return {string[]}
|
||||
*/
|
||||
|
||||
|
||||
module.exports.numberHints = function numberHints(schema, logic) {
|
||||
const hints = [schema.type === "integer" ? "integer" : "number"];
|
||||
const range = new Range();
|
||||
|
||||
if (typeof schema.minimum === "number") {
|
||||
range.left(schema.minimum);
|
||||
}
|
||||
|
||||
if (typeof schema.exclusiveMinimum === "number") {
|
||||
range.left(schema.exclusiveMinimum, true);
|
||||
}
|
||||
|
||||
if (typeof schema.maximum === "number") {
|
||||
range.right(schema.maximum);
|
||||
}
|
||||
|
||||
if (typeof schema.exclusiveMaximum === "number") {
|
||||
range.right(schema.exclusiveMaximum, true);
|
||||
}
|
||||
|
||||
const rangeFormat = range.format(logic);
|
||||
|
||||
if (rangeFormat) {
|
||||
hints.push(rangeFormat);
|
||||
}
|
||||
|
||||
if (typeof schema.multipleOf === "number") {
|
||||
hints.push(`should${logic ? "" : " not"} be multiple of ${schema.multipleOf}`);
|
||||
}
|
||||
|
||||
return hints;
|
||||
};
|
163
web/node_modules/sass-loader/node_modules/schema-utils/dist/validate.js
generated
vendored
Normal file
163
web/node_modules/sass-loader/node_modules/schema-utils/dist/validate.js
generated
vendored
Normal file
|
@ -0,0 +1,163 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validate = validate;
|
||||
Object.defineProperty(exports, "ValidationError", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _ValidationError.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _absolutePath = _interopRequireDefault(require("./keywords/absolutePath"));
|
||||
|
||||
var _ValidationError = _interopRequireDefault(require("./ValidationError"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
// Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110).
|
||||
const Ajv = require("ajv");
|
||||
|
||||
const ajvKeywords = require("ajv-keywords");
|
||||
/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */
|
||||
|
||||
/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */
|
||||
|
||||
/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */
|
||||
|
||||
/** @typedef {import("ajv").ErrorObject} ErrorObject */
|
||||
|
||||
/**
|
||||
* @typedef {Object} Extend
|
||||
* @property {number=} formatMinimum
|
||||
* @property {number=} formatMaximum
|
||||
* @property {boolean=} formatExclusiveMinimum
|
||||
* @property {boolean=} formatExclusiveMaximum
|
||||
* @property {string=} link
|
||||
*/
|
||||
|
||||
/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */
|
||||
|
||||
/** @typedef {ErrorObject & { children?: Array<ErrorObject>}} SchemaUtilErrorObject */
|
||||
|
||||
/**
|
||||
* @callback PostFormatter
|
||||
* @param {string} formattedError
|
||||
* @param {SchemaUtilErrorObject} error
|
||||
* @returns {string}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} ValidationErrorConfiguration
|
||||
* @property {string=} name
|
||||
* @property {string=} baseDataPath
|
||||
* @property {PostFormatter=} postFormatter
|
||||
*/
|
||||
|
||||
|
||||
const ajv = new Ajv({
|
||||
allErrors: true,
|
||||
verbose: true,
|
||||
$data: true
|
||||
});
|
||||
ajvKeywords(ajv, ["instanceof", "formatMinimum", "formatMaximum", "patternRequired"]); // Custom keywords
|
||||
|
||||
(0, _absolutePath.default)(ajv);
|
||||
/**
|
||||
* @param {Schema} schema
|
||||
* @param {Array<object> | object} options
|
||||
* @param {ValidationErrorConfiguration=} configuration
|
||||
* @returns {void}
|
||||
*/
|
||||
|
||||
function validate(schema, options, configuration) {
|
||||
let errors = [];
|
||||
|
||||
if (Array.isArray(options)) {
|
||||
errors = Array.from(options, nestedOptions => validateObject(schema, nestedOptions));
|
||||
errors.forEach((list, idx) => {
|
||||
const applyPrefix =
|
||||
/**
|
||||
* @param {SchemaUtilErrorObject} error
|
||||
*/
|
||||
error => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
error.dataPath = `[${idx}]${error.dataPath}`;
|
||||
|
||||
if (error.children) {
|
||||
error.children.forEach(applyPrefix);
|
||||
}
|
||||
};
|
||||
|
||||
list.forEach(applyPrefix);
|
||||
});
|
||||
errors = errors.reduce((arr, items) => {
|
||||
arr.push(...items);
|
||||
return arr;
|
||||
}, []);
|
||||
} else {
|
||||
errors = validateObject(schema, options);
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
throw new _ValidationError.default(errors, schema, configuration);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {Schema} schema
|
||||
* @param {Array<object> | object} options
|
||||
* @returns {Array<SchemaUtilErrorObject>}
|
||||
*/
|
||||
|
||||
|
||||
function validateObject(schema, options) {
|
||||
const compiledSchema = ajv.compile(schema);
|
||||
const valid = compiledSchema(options);
|
||||
if (valid) return [];
|
||||
return compiledSchema.errors ? filterErrors(compiledSchema.errors) : [];
|
||||
}
|
||||
/**
|
||||
* @param {Array<ErrorObject>} errors
|
||||
* @returns {Array<SchemaUtilErrorObject>}
|
||||
*/
|
||||
|
||||
|
||||
function filterErrors(errors) {
|
||||
/** @type {Array<SchemaUtilErrorObject>} */
|
||||
let newErrors = [];
|
||||
|
||||
for (const error of
|
||||
/** @type {Array<SchemaUtilErrorObject>} */
|
||||
errors) {
|
||||
const {
|
||||
dataPath
|
||||
} = error;
|
||||
/** @type {Array<SchemaUtilErrorObject>} */
|
||||
|
||||
let children = [];
|
||||
newErrors = newErrors.filter(oldError => {
|
||||
if (oldError.dataPath.includes(dataPath)) {
|
||||
if (oldError.children) {
|
||||
children = children.concat(oldError.children.slice(0));
|
||||
} // eslint-disable-next-line no-undefined, no-param-reassign
|
||||
|
||||
|
||||
oldError.children = undefined;
|
||||
children.push(oldError);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (children.length) {
|
||||
error.children = children;
|
||||
}
|
||||
|
||||
newErrors.push(error);
|
||||
}
|
||||
|
||||
return newErrors;
|
||||
}
|
78
web/node_modules/sass-loader/node_modules/schema-utils/package.json
generated
vendored
Normal file
78
web/node_modules/sass-loader/node_modules/schema-utils/package.json
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
"name": "schema-utils",
|
||||
"version": "3.1.1",
|
||||
"description": "webpack Validation Utils",
|
||||
"license": "MIT",
|
||||
"repository": "webpack/schema-utils",
|
||||
"author": "webpack Contrib (https://github.com/webpack-contrib)",
|
||||
"homepage": "https://github.com/webpack/schema-utils",
|
||||
"bugs": "https://github.com/webpack/schema-utils/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"types": "declarations/index.d.ts",
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run build -- -w",
|
||||
"clean": "del-cli dist declarations",
|
||||
"prebuild": "npm run clean",
|
||||
"build:types": "tsc --declaration --emitDeclarationOnly --outDir declarations && prettier \"declarations/**/*.ts\" --write",
|
||||
"build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
||||
"build": "npm-run-all -p \"build:**\"",
|
||||
"commitlint": "commitlint --from=master",
|
||||
"security": "npm audit --production",
|
||||
"fmt:check": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
|
||||
"lint:js": "eslint --cache .",
|
||||
"lint:types": "tsc --pretty --noEmit",
|
||||
"lint": "npm-run-all lint:js lint:types fmt:check",
|
||||
"fmt": "npm run fmt:check -- --write",
|
||||
"fix:js": "npm run lint:js -- --fix",
|
||||
"fix": "npm-run-all fix:js fmt",
|
||||
"test:only": "cross-env NODE_ENV=test jest",
|
||||
"test:watch": "npm run test:only -- --watch",
|
||||
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run test:coverage",
|
||||
"prepare": "npm run build && husky install",
|
||||
"release": "standard-version"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"declarations"
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.8",
|
||||
"ajv": "^6.12.5",
|
||||
"ajv-keywords": "^3.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.14.3",
|
||||
"@babel/core": "^7.14.6",
|
||||
"@babel/preset-env": "^7.14.7",
|
||||
"@commitlint/cli": "^12.1.4",
|
||||
"@commitlint/config-conventional": "^12.1.4",
|
||||
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
||||
"babel-jest": "^27.0.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"del": "^6.0.0",
|
||||
"del-cli": "^3.0.1",
|
||||
"eslint": "^7.31.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"husky": "^6.0.0",
|
||||
"jest": "^27.0.6",
|
||||
"lint-staged": "^11.0.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.3.2",
|
||||
"standard-version": "^9.3.1",
|
||||
"typescript": "^4.3.5",
|
||||
"webpack": "^5.45.1"
|
||||
},
|
||||
"keywords": [
|
||||
"webpack"
|
||||
]
|
||||
}
|
106
web/node_modules/sass-loader/package.json
generated
vendored
Normal file
106
web/node_modules/sass-loader/package.json
generated
vendored
Normal file
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"name": "sass-loader",
|
||||
"version": "10.2.0",
|
||||
"description": "Sass loader for webpack",
|
||||
"license": "MIT",
|
||||
"repository": "webpack-contrib/sass-loader",
|
||||
"author": "J. Tangelder",
|
||||
"homepage": "https://github.com/webpack-contrib/sass-loader",
|
||||
"bugs": "https://github.com/webpack-contrib/sass-loader/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/webpack"
|
||||
},
|
||||
"main": "dist/cjs.js",
|
||||
"engines": {
|
||||
"node": ">= 10.13.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run build -- -w",
|
||||
"clean": "del-cli dist",
|
||||
"prebuild": "npm run clean",
|
||||
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
||||
"commitlint": "commitlint --from=master",
|
||||
"security": "npm audit",
|
||||
"lint:prettier": "prettier --list-different .",
|
||||
"lint:js": "eslint --cache .",
|
||||
"lint": "npm-run-all -l -p \"lint:**\"",
|
||||
"test:only": "cross-env NODE_ENV=test jest",
|
||||
"test:watch": "npm run test:only -- --watch",
|
||||
"test:manual": "npm run build && webpack-dev-server test/manual/src/index.js --open --config test/manual/webpack.config.js",
|
||||
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run test:coverage",
|
||||
"prepare": "npm run build",
|
||||
"release": "standard-version",
|
||||
"defaults": "webpack-defaults"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"fibers": ">= 3.1.0",
|
||||
"node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0",
|
||||
"sass": "^1.3.0",
|
||||
"webpack": "^4.36.0 || ^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"node-sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
},
|
||||
"fibers": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"klona": "^2.0.4",
|
||||
"loader-utils": "^2.0.0",
|
||||
"neo-async": "^2.6.2",
|
||||
"schema-utils": "^3.0.0",
|
||||
"semver": "^7.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.12.1",
|
||||
"@babel/core": "^7.12.3",
|
||||
"@babel/preset-env": "^7.12.1",
|
||||
"@commitlint/cli": "^11.0.0",
|
||||
"@commitlint/config-conventional": "^11.0.0",
|
||||
"@webpack-contrib/defaults": "^6.3.0",
|
||||
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
||||
"babel-jest": "^26.6.3",
|
||||
"bootstrap": "^4.5.3",
|
||||
"bootstrap-sass": "^3.4.1",
|
||||
"cross-env": "^7.0.2",
|
||||
"css-loader": "^5.0.1",
|
||||
"del": "^6.0.0",
|
||||
"del-cli": "^3.0.1",
|
||||
"enhanced-resolve": "^5.5.0",
|
||||
"eslint": "^7.13.0",
|
||||
"eslint-config-prettier": "^7.1.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"fibers": "^5.0.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"foundation-sites": "^6.6.3",
|
||||
"husky": "^4.3.0",
|
||||
"jest": "^26.6.3",
|
||||
"lint-staged": "^10.5.1",
|
||||
"material-components-web": "^8.0.0",
|
||||
"memfs": "^3.2.0",
|
||||
"node-sass": "^5.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.1.2",
|
||||
"sass": "^1.29.0",
|
||||
"standard-version": "^9.0.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"webpack": "^5.12.2"
|
||||
},
|
||||
"keywords": [
|
||||
"sass",
|
||||
"libsass",
|
||||
"webpack",
|
||||
"loader"
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue