From 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Wed, 18 Nov 2020 23:26:45 +0100 Subject: rm node_modules --- node_modules/sass-loader/CHANGELOG.md | 297 --------------------- node_modules/sass-loader/LICENSE | 18 -- node_modules/sass-loader/README.md | 241 ----------------- node_modules/sass-loader/lib/formatSassError.js | 73 ----- node_modules/sass-loader/lib/importsToResolve.js | 58 ---- node_modules/sass-loader/lib/loader.js | 83 ------ node_modules/sass-loader/lib/normalizeOptions.js | 78 ------ .../sass-loader/lib/proxyCustomImporters.js | 29 -- node_modules/sass-loader/lib/webpackImporter.js | 73 ----- node_modules/sass-loader/package.json | 100 ------- 10 files changed, 1050 deletions(-) delete mode 100644 node_modules/sass-loader/CHANGELOG.md delete mode 100644 node_modules/sass-loader/LICENSE delete mode 100644 node_modules/sass-loader/README.md delete mode 100644 node_modules/sass-loader/lib/formatSassError.js delete mode 100644 node_modules/sass-loader/lib/importsToResolve.js delete mode 100644 node_modules/sass-loader/lib/loader.js delete mode 100644 node_modules/sass-loader/lib/normalizeOptions.js delete mode 100644 node_modules/sass-loader/lib/proxyCustomImporters.js delete mode 100644 node_modules/sass-loader/lib/webpackImporter.js delete mode 100644 node_modules/sass-loader/package.json (limited to 'node_modules/sass-loader') diff --git a/node_modules/sass-loader/CHANGELOG.md b/node_modules/sass-loader/CHANGELOG.md deleted file mode 100644 index 18e0278..0000000 --- a/node_modules/sass-loader/CHANGELOG.md +++ /dev/null @@ -1,297 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -## [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)) - - - - -## [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 - - - -# [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)) - - - -# [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) - - - -# [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` - - - -# [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) - - - -# [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) - - - -# [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 - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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 - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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` - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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)) - - - -# [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) - - - -# [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) - - - -# [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) - - - -# [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` - - - -# [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` - - - -# [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) diff --git a/node_modules/sass-loader/LICENSE b/node_modules/sass-loader/LICENSE deleted file mode 100644 index 0337438..0000000 --- a/node_modules/sass-loader/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright JS Foundation and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/sass-loader/README.md b/node_modules/sass-loader/README.md deleted file mode 100644 index a233fab..0000000 --- a/node_modules/sass-loader/README.md +++ /dev/null @@ -1,241 +0,0 @@ -[![npm][npm]][npm-url] -[![node][node]][node-url] -[![npm-stats][npm-stats]][npm-url] -[![deps][deps]][deps-url] -[![travis][travis]][travis-url] -[![appveyor][appveyor]][appveyor-url] -[![coverage][cover]][cover-url] -[![chat][chat]][chat-url] - -
- - - - -

SASS Loader

-

Loads a SASS/SCSS file and compiles it to CSS.

-
- -Use the [css-loader](https://github.com/webpack-contrib/css-loader) or the [raw-loader](https://github.com/webpack-contrib/raw-loader) to turn it into a JS module and the [ExtractTextPlugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) to extract it into a separate file. -Looking for the webpack 1 loader? Check out the [archive/webpack-1 branch](https://github.com/webpack-contrib/sass-loader/tree/archive/webpack-1). - -

Install

- -```bash -npm install sass-loader node-sass webpack --save-dev -``` - -The sass-loader requires [node-sass](https://github.com/sass/node-sass) and [webpack](https://github.com/webpack) -as [`peerDependency`](https://docs.npmjs.com/files/package.json#peerdependencies). Thus you are able to control the versions accurately. - -

Examples

- -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. - -```bash -npm install style-loader css-loader --save-dev -``` - -```js -// webpack.config.js -module.exports = { - ... - module: { - rules: [{ - test: /\.scss$/, - use: [{ - loader: "style-loader" // creates style nodes from JS strings - }, { - loader: "css-loader" // translates CSS into CommonJS - }, { - loader: "sass-loader" // compiles Sass to CSS - }] - }] - } -}; -``` - -You can also pass options directly to [node-sass](https://github.com/andrew/node-sass) by specifying an `options` property like this: - -```js -// webpack.config.js -module.exports = { - ... - module: { - rules: [{ - test: /\.scss$/, - use: [{ - loader: "style-loader" - }, { - loader: "css-loader" - }, { - loader: "sass-loader", - options: { - includePaths: ["absolute/path/a", "absolute/path/b"] - } - }] - }] - } -}; -``` - -See [node-sass](https://github.com/andrew/node-sass) for all available Sass options. - -### In production - -Usually, it's recommended to extract the style sheets into a dedicated file in production using the [ExtractTextPlugin](https://github.com/webpack-contrib/extract-text-webpack-plugin). This way your styles are not dependent on JavaScript: - -```js -const ExtractTextPlugin = require("extract-text-webpack-plugin"); - -const extractSass = new ExtractTextPlugin({ - filename: "[name].[contenthash].css", - disable: process.env.NODE_ENV === "development" -}); - -module.exports = { - ... - module: { - rules: [{ - test: /\.scss$/, - use: extractSass.extract({ - use: [{ - loader: "css-loader" - }, { - loader: "sass-loader" - }], - // use style-loader in development - fallback: "style-loader" - }) - }] - }, - plugins: [ - extractSass - ] -}; -``` - -

Usage

- -### Imports - -webpack provides an [advanced mechanism to resolve files](https://webpack.js.org/concepts/module-resolution/). The sass-loader uses node-sass' 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: - -```css -@import "~bootstrap/dist/css/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 "file"` is the same as `@import "./file";` - -### Problems with `url(...)` - -Since Sass/[libsass](https://github.com/sass/libsass) does not provide [url rewriting](https://github.com/sass/libsass/issues/532), all linked assets must be relative to the output. - -- If you're just generating CSS without passing it to the css-loader, it must be relative to your web root. -- If you pass the generated CSS on to the css-loader, all urls must be relative to the entry-file (e.g. `main.scss`). - -More likely you will be disrupted by this second issue. It is natural to expect relative references to be resolved against the `.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 the 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`. Check out [this working bootstrap example](https://github.com/webpack-contrib/sass-loader/tree/master/test/bootstrapSass). - -### Extracting style sheets - -Bundling CSS with webpack has some nice advantages like referencing images and fonts with hashed urls or [hot module replacement](https://webpack.js.org/concepts/hot-module-replacement/) in development. In production, on the other hand, it's not a good idea to apply your style sheets depending on JS execution. Rendering may be delayed or even a [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) might be visible. Thus it's often still better to have them as separate files in your final production build. - -There are two possibilities to extract a style sheet from the bundle: - -- [extract-loader](https://github.com/peerigon/extract-loader) (simpler, but specialized on the css-loader's output) -- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) (more complex, but works in all use-cases) - -### Source maps - -To enable CSS source maps, you'll need to pass the `sourceMap` option to the sass-loader *and* the css-loader. Your `webpack.config.js` should look like this: - -```javascript -module.exports = { - ... - devtool: "source-map", // any "source-map"-like devtool is possible - module: { - rules: [{ - test: /\.scss$/, - use: [{ - loader: "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. - -### Environment variables - -If you want to prepend Sass code before the actual entry file, you can set the `data` option. In this case, the sass-loader will not override the `data` option but just append the entry's content. This is especially useful when some of your Sass variables depend on the environment: - -```javascript -{ - loader: "sass-loader", - options: { - data: "$env: " + process.env.NODE_ENV + ";" - } -} -``` - -**Please note:** Since you're injecting code, this will break the source mappings in your entry file. Often there's a simpler solution than this, like multiple Sass entry files. - -

Maintainers

- - - - - - - -
-
- Johannes Ewald -
-
- Jorik Tangelder -
-
- Kiran -
- - -

License

- -[MIT](http://www.opensource.org/licenses/mit-license.php) - -[npm]: https://img.shields.io/npm/v/sass-loader.svg -[npm-stats]: https://img.shields.io/npm/dm/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 - -[travis]: http://img.shields.io/travis/webpack-contrib/sass-loader.svg -[travis-url]: https://travis-ci.org/webpack-contrib/sass-loader - -[appveyor-url]: https://ci.appveyor.com/project/webpack-contrib/sass-loader/branch/master -[appveyor]: https://ci.appveyor.com/api/projects/status/rqpy1vaovh20ttxs/branch/master?svg=true - -[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 diff --git a/node_modules/sass-loader/lib/formatSassError.js b/node_modules/sass-loader/lib/formatSassError.js deleted file mode 100644 index 3d4652b..0000000 --- a/node_modules/sass-loader/lib/formatSassError.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -const path = require("path"); -const os = require("os"); -const fs = require("fs"); - -// A typical sass error looks like this -const SassError = { // eslint-disable-line no-unused-vars - message: "invalid property name", - column: 14, - line: 1, - file: "stdin", - status: 1 -}; - -/** - * Enhances the sass error with additional information about what actually went wrong. - * - * @param {SassError} err - * @param {string} resourcePath - */ -function formatSassError(err, resourcePath) { - // Instruct webpack to hide the JS stack from the console - // Usually you're only interested in the SASS stack in this case. - err.hideStack = true; - - // The file property is missing in rare cases. - // No improvement in the error is possible. - if (!err.file) { - return; - } - - let msg = err.message; - - if (err.file === "stdin") { - err.file = resourcePath; - } - // node-sass returns UNIX-style paths - err.file = path.normalize(err.file); - - // The 'Current dir' hint of node-sass does not help us, we're providing - // additional information by reading the err.file property - msg = msg.replace(/\s*Current dir:\s*/, ""); - - err.message = getFileExcerptIfPossible(err) + - msg.charAt(0).toUpperCase() + msg.slice(1) + os.EOL + - " in " + err.file + " (line " + err.line + ", column " + err.column + ")"; -} - -/** - * Tries to get an excerpt of the file where the error happened. - * Uses err.line and err.column. - * - * Returns an empty string if the excerpt could not be retrieved. - * - * @param {SassError} err - * @returns {string} - */ -function getFileExcerptIfPossible(err) { - try { - const content = fs.readFileSync(err.file, "utf8"); - - return os.EOL + - content.split(os.EOL)[err.line - 1] + os.EOL + - new Array(err.column - 1).join(" ") + "^" + os.EOL + - " "; - } catch (err) { - // If anything goes wrong here, we don't want any errors to be reported to the user - return ""; - } -} - -module.exports = formatSassError; diff --git a/node_modules/sass-loader/lib/importsToResolve.js b/node_modules/sass-loader/lib/importsToResolve.js deleted file mode 100644 index 595fc4a..0000000 --- a/node_modules/sass-loader/lib/importsToResolve.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; - -const path = require("path"); - -// libsass uses this precedence when importing files without extension -const extPrecedence = [".scss", ".sass", ".css"]; - -/** - * When libsass 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. - * - * @param {string} request - * @returns {Array} - */ -function importsToResolve(request) { - // libsass' import algorithm works like this: - // In case there is no file extension... - // - Prefer modules starting with '_'. - // - File extension precedence: .scss, .sass, .css. - // In case there is a file extension... - // - If the file is a CSS-file, do not include it all, but just link it via @import url(). - // - The exact file name must match (no auto-resolving of '_'-modules). - - // 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.extname(request); - const basename = path.basename(request); - const dirname = path.dirname(request); - const startsWithUnderscore = basename.charAt(0) === "_"; - const hasCssExt = ext === ".css"; - const hasSassExt = ext === ".scss" || ext === ".sass"; - - // a module import is an identifier like 'bootstrap-sass' - // We also need to check for dirname since it might also be a deep import like 'bootstrap-sass/something' - let isModuleImport = request.charAt(0) !== "." && dirname === "."; - - if (dirname.charAt(0) === "@") { - // Check whether it is a deep import from scoped npm package - // (i.e. @pkg/foo/file), if so, process import as file import; - // otherwise, if we import from root npm scoped package (i.e. @pkg/foo) - // process import as a module import. - isModuleImport = !(dirname.indexOf("/") > -1); - } - - return (isModuleImport && [request]) || // Do not modify module imports - (hasCssExt && []) || // Do not import css files - (hasSassExt && [request]) || // Do not modify imports with explicit extensions - (startsWithUnderscore ? [] : extPrecedence) // Do not add underscore imports if there is already an underscore - .map(ext => "_" + basename + ext) - .concat( - extPrecedence.map(ext => basename + ext) - ).map( - file => dirname + "/" + file // No path.sep required here, because imports inside SASS are usually with / - ); -} - -module.exports = importsToResolve; diff --git a/node_modules/sass-loader/lib/loader.js b/node_modules/sass-loader/lib/loader.js deleted file mode 100644 index 0a1fcd7..0000000 --- a/node_modules/sass-loader/lib/loader.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; - -const sass = require("node-sass"); -const path = require("path"); -const async = require("neo-async"); -const formatSassError = require("./formatSassError"); -const webpackImporter = require("./webpackImporter"); -const normalizeOptions = require("./normalizeOptions"); -const pify = require("pify"); - -// This queue makes sure node-sass leaves one thread available for executing -// fs tasks when running the custom importer code. -// This can be removed as soon as node-sass implements a fix for this. -const threadPoolSize = process.env.UV_THREADPOOL_SIZE || 4; -const asyncSassJobQueue = async.queue(sass.render, threadPoolSize - 1); - -/** - * The sass-loader makes node-sass available to webpack modules. - * - * @this {LoaderContext} - * @param {string} content - */ -function sassLoader(content) { - const callback = this.async(); - const isSync = typeof callback !== "function"; - const self = this; - const resourcePath = this.resourcePath; - - function addNormalizedDependency(file) { - // node-sass returns POSIX paths - self.dependency(path.normalize(file)); - } - - if (isSync) { - throw new Error("Synchronous compilation is not supported anymore. See https://github.com/webpack-contrib/sass-loader/issues/333"); - } - - const options = normalizeOptions(this, content, webpackImporter( - resourcePath, - pify(this.resolve.bind(this)), - addNormalizedDependency - )); - - // Skip empty files, otherwise it will stop webpack, see issue #21 - if (options.data.trim() === "") { - callback(null, ""); - return; - } - - // start the actual rendering - asyncSassJobQueue.push(options, (err, result) => { - if (err) { - formatSassError(err, this.resourcePath); - err.file && this.dependency(err.file); - callback(err); - return; - } - - if (result.map && result.map !== "{}") { - result.map = JSON.parse(result.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. - delete result.map.file; - // The first source is 'stdin' according to node-sass because we've used the data input. - // Now let's override that value with the correct relative path. - // Since we specified options.sourceMap = path.join(process.cwd(), "/sass.map"); in normalizeOptions, - // we know that this path is relative to process.cwd(). This is how node-sass works. - result.map.sources[0] = path.relative(process.cwd(), resourcePath); - // 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 - result.map.sourceRoot = path.normalize(result.map.sourceRoot); - result.map.sources = result.map.sources.map(path.normalize); - } else { - result.map = null; - } - - result.stats.includedFiles.forEach(addNormalizedDependency); - callback(null, result.css.toString(), result.map); - }); -} - -module.exports = sassLoader; diff --git a/node_modules/sass-loader/lib/normalizeOptions.js b/node_modules/sass-loader/lib/normalizeOptions.js deleted file mode 100644 index ad1ca1e..0000000 --- a/node_modules/sass-loader/lib/normalizeOptions.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; - -const os = require("os"); -const utils = require("loader-utils"); -const cloneDeep = require("clone-deep"); -const path = require("path"); -const proxyCustomImporters = require("./proxyCustomImporters"); - -/** - * Derives the sass options from the loader context and normalizes its values with sane defaults. - * - * Please note: If loaderContext.query is an options object, it will be re-used across multiple invocations. - * That's why we must not modify the object directly. - * - * @param {LoaderContext} loaderContext - * @param {string} content - * @param {Function} webpackImporter - * @returns {Object} - */ -function normalizeOptions(loaderContext, content, webpackImporter) { - const options = cloneDeep(utils.getOptions(loaderContext)) || {}; - const resourcePath = loaderContext.resourcePath; - - options.data = options.data ? (options.data + os.EOL + content) : content; - - // opt.outputStyle - if (!options.outputStyle && loaderContext.minimize) { - options.outputStyle = "compressed"; - } - - // opt.sourceMap - // Not using the `this.sourceMap` flag because css source maps are different - // @see https://github.com/webpack/css-loader/pull/40 - if (options.sourceMap) { - // 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 = path.join(process.cwd(), "/sass.map"); - if ("sourceMapRoot" in options === false) { - options.sourceMapRoot = process.cwd(); - } - if ("omitSourceMapUrl" in options === false) { - // The source map url doesn't make sense because we don't know the output path - // The css-loader will handle that for us - options.omitSourceMapUrl = true; - } - if ("sourceMapContents" in options === false) { - // If sourceMapContents option is not set, set it to true otherwise maps will be empty/null - // when exported by webpack-extract-text-plugin. - options.sourceMapContents = true; - } - } - - // indentedSyntax is a boolean flag. - const ext = path.extname(resourcePath); - - // If we are compiling sass and indentedSyntax isn't set, automatically set it. - if (ext && ext.toLowerCase() === ".sass" && "indentedSyntax" in options === false) { - options.indentedSyntax = true; - } else { - options.indentedSyntax = Boolean(options.indentedSyntax); - } - - // Allow passing custom importers to `node-sass`. Accepts `Function` or an array of `Function`s. - options.importer = options.importer ? proxyCustomImporters(options.importer, resourcePath) : []; - options.importer.push(webpackImporter); - - // `node-sass` uses `includePaths` to resolve `@import` paths. Append the currently processed file. - options.includePaths = options.includePaths || []; - options.includePaths.push(path.dirname(resourcePath)); - - return options; -} - -module.exports = normalizeOptions; diff --git a/node_modules/sass-loader/lib/proxyCustomImporters.js b/node_modules/sass-loader/lib/proxyCustomImporters.js deleted file mode 100644 index b15a917..0000000 --- a/node_modules/sass-loader/lib/proxyCustomImporters.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -/** - * Creates new custom importers that use the given `resourcePath` if libsass calls the custom importer with `prev` - * being 'stdin'. - * - * Why do we need this? We have to use the `data` option of node-sass in order to compile our sass because - * the `resourcePath` might not be an actual file on disk. When using the `data` option, libsass uses the string - * 'stdin' instead of a filename. - * - * We have to fix this behavior in order to provide a consistent experience to the webpack user. - * - * @param {function|Array} importer - * @param {string} resourcePath - * @returns {Array} - */ -function proxyCustomImporters(importer, resourcePath) { - return [].concat(importer).map((importer) => { - return function (url, prev, done) { - return importer.apply( - this, // eslint-disable-line no-invalid-this - Array.from(arguments) - .map((arg, i) => i === 1 && arg === "stdin" ? resourcePath : arg) - ); - }; - }); -} - -module.exports = proxyCustomImporters; diff --git a/node_modules/sass-loader/lib/webpackImporter.js b/node_modules/sass-loader/lib/webpackImporter.js deleted file mode 100644 index 44cbdfe..0000000 --- a/node_modules/sass-loader/lib/webpackImporter.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -/** - * @name PromisedResolve - * @type {Function} - * @param {string} dir - * @param {string} request - * @returns Promise - */ - -/** - * @name Importer - * @type {Function} - * @param {string} url - * @param {string} prev - * @param {Function} done - */ - -const path = require("path"); -const utils = require("loader-utils"); -const tail = require("lodash.tail"); -const importsToResolve = require("./importsToResolve"); - -const matchCss = /\.css$/; - -/** - * Returns an importer that uses webpack's resolving algorithm. - * - * It's important that the returned function has the correct number of arguments - * (based on whether the call is sync or async) because otherwise node-sass doesn't exit. - * - * @param {string} resourcePath - * @param {PromisedResolve} resolve - * @param {Function} addNormalizedDependency - * @returns {Importer} - */ -function webpackImporter(resourcePath, resolve, addNormalizedDependency) { - function dirContextFrom(fileContext) { - return path.dirname( - // The first file is 'stdin' when we're using the data option - fileContext === "stdin" ? resourcePath : fileContext - ); - } - - function startResolving(dir, importsToResolve) { - return importsToResolve.length === 0 ? - Promise.reject() : - resolve(dir, importsToResolve[0]) - .then(resolvedFile => { - // Add the resolvedFilename 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. - addNormalizedDependency(resolvedFile); - return { - // By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it. - file: resolvedFile.replace(matchCss, "") - }; - }, () => startResolving( - dir, - tail(importsToResolve) - )); - } - - return (url, prev, done) => { - startResolving( - dirContextFrom(prev), - importsToResolve(utils.urlToRequest(url)) - ) // Catch all resolving errors, return the original file and pass responsibility back to other custom importers - .catch(() => ({ file: url })) - .then(done); - }; -} - -module.exports = webpackImporter; diff --git a/node_modules/sass-loader/package.json b/node_modules/sass-loader/package.json deleted file mode 100644 index 1fdd573..0000000 --- a/node_modules/sass-loader/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "_from": "sass-loader@^6.0.7", - "_id": "sass-loader@6.0.7", - "_inBundle": false, - "_integrity": "sha512-JoiyD00Yo1o61OJsoP2s2kb19L1/Y2p3QFcCdWdF6oomBGKVYuZyqHWemRBfQ2uGYsk+CH3eCguXNfpjzlcpaA==", - "_location": "/sass-loader", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "sass-loader@^6.0.7", - "name": "sass-loader", - "escapedName": "sass-loader", - "rawSpec": "^6.0.7", - "saveSpec": null, - "fetchSpec": "^6.0.7" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-6.0.7.tgz", - "_shasum": "dd2fdb3e7eeff4a53f35ba6ac408715488353d00", - "_spec": "sass-loader@^6.0.7", - "_where": "/home/pruss/Dev/3-minute-website", - "author": { - "name": "J. Tangelder" - }, - "bugs": { - "url": "https://github.com/webpack-contrib/sass-loader/issues" - }, - "bundleDependencies": false, - "dependencies": { - "clone-deep": "^2.0.1", - "loader-utils": "^1.0.1", - "lodash.tail": "^4.1.1", - "neo-async": "^2.5.0", - "pify": "^3.0.0" - }, - "deprecated": false, - "description": "Sass loader for webpack", - "devDependencies": { - "bootstrap-sass": "^3.3.5", - "css-loader": "^0.28.4", - "eslint": "^3.16.0", - "eslint-config-peerigon": "^9.0.0", - "eslint-plugin-jsdoc": "^2.4.0", - "file-loader": "^0.11.2", - "mocha": "^3.0.2", - "node-sass": "^4.5.0", - "nyc": "^11.0.2", - "raw-loader": "^0.5.1", - "should": "^11.2.0", - "standard-version": "^4.2.0", - "style-loader": "^0.18.2", - "webpack-dev-server": "^2.4.1", - "webpack-merge": "^4.0.0" - }, - "engines": { - "node": ">= 4.3 < 5.0.0 || >= 5.10" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/webpack-contrib/sass-loader", - "keywords": [ - "sass", - "libsass", - "webpack", - "loader" - ], - "license": "MIT", - "main": "lib/loader.js", - "name": "sass-loader", - "peerDependencies": { - "node-sass": "^4.0.0", - "webpack": "^2.0.0 || ^3.0.0 || ^4.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/webpack-contrib/sass-loader.git" - }, - "scripts": { - "appveyor:test": "npm test", - "create-spec": "node test/tools/runCreateSpec.js", - "lint": "eslint lib test", - "posttest": "npm run lint", - "pretest": "npm run create-spec", - "release": "standard-version", - "test": "nyc --all mocha -R spec -t 10000", - "test-bootstrap-sass": "webpack-dev-server --config test/bootstrapSass/webpack.config.js --content-base ./test/bootstrapSass", - "test-extract-text": "webpack --config test/extractText/webpack.config.js", - "test-hmr": "webpack-dev-server --config test/hmr/webpack.config.js --content-base ./test/hmr --hot --inline", - "test-source-map": "webpack-dev-server --config test/sourceMap/webpack.config.js --content-base ./test/sourceMap --inline", - "test-watch": "webpack --config test/watch/webpack.config.js", - "travis:coverage": "npm run test", - "travis:lint": "npm run lint", - "travis:test": "npm run test" - }, - "version": "6.0.7" -} -- cgit v1.2.3