Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sass-loader

webpack-contrib64.1mMIT16.0.5TypeScript support: definitely-typed

Sass loader for webpack

sass, libsass, webpack, loader

readme

npm node tests coverage discussion size

sass-loader

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

Getting Started

To begin, you'll need to install sass-loader:

npm install sass-loader sass webpack --save-dev

or

yarn add -D sass-loader sass webpack

or

pnpm add -D sass-loader sass webpack

[!NOTE]

To enable CSS processing in your project, you need to install style-loader and css-loader via npm i style-loader css-loader.

sass-loader requires you to install either Dart Sass, Node Sass on your own (more documentation can be found below) or Sass Embedded.

This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use.

[!NOTE]

We highly recommend using Sass Embedded or Dart Sass.

[!WARNING]

Node Sass does not work with Yarn PnP and doesn't support @use rule.

Chain the sass-loader with the css-loader and the style-loader to immediately apply all styles to the DOM or the mini-css-extract-plugin to extract it into a separate file.

Then add the loader to your webpack configuration. For example:

app.js

import "./style.scss";

style.scss

$body-color: red;

body {
  color: $body-color;
}

webpack.config.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.

The style (new API, by default since 16 version) and outputStyle (old API) options in production mode

For production mode, the style (new API, by default since 16 version) and outputStyle (old API) options default to compressed unless otherwise specified in sassOptions.

Resolving import and use at-rules

Webpack provides an advanced mechanism to resolve files.

The sass-loader uses Sass's custom importer feature to pass all queries to the webpack resolving engine enabling you to import your Sass modules from node_modules.

@import "bootstrap";

Using ~ is deprecated and should be removed from your code, but we still support it for historical reasons. Why can you remove it? The loader will first try to resolve @import as a relative path. If it cannot be resolved, then the loader will try to resolve @import inside node_modules.

Prepending module paths with a ~ tells webpack to search through node_modules.

@import "~bootstrap";

It's important to prepend the path with only ~, 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, 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 might be surprised by this first issue, as 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 two solutions to this problem:

  • Add the missing url rewriting using the 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 for example has an $icon-font-path.

Options

implementation

Type:

type implementation = object | string;

Default: sass

The special implementation option determines which implementation of Sass to use.

By default, the loader resolves the implementation based on your dependencies. Just add the desired implementation to your package.json (sass, sass-embedded, or node-sass package) and install dependencies.

Example where the sass-loader loader uses the sass (dart-sass) implementation:

package.json

{
  "devDependencies": {
    "sass-loader": "^7.2.0",
    "sass": "^1.22.10"
  }
}

Example where the sass-loader loader uses the node-sass implementation:

package.json

{
  "devDependencies": {
    "sass-loader": "^7.2.0",
    "node-sass": "^5.0.0"
  }
}

Example where the sass-loader loader uses the sass-embedded implementation:

package.json

{
  "devDependencies": {
    "sass-loader": "^7.2.0",
    "sass": "^1.22.10"
  },
  "optionalDependencies": {
    "sass-embedded": "^1.70.0"
  }
}

[!NOTE]

Using optionalDependencies means that sass-loader can fallback to sass when running on an operating system not supported by sass-embedded

Be aware of the order that sass-loader will resolve the implementation:

  1. sass-embedded
  2. sass
  3. node-sass

You can specify a specific implementation by using the implementation option, which accepts one of the above values.

object

For example, to always use Dart Sass, you'd pass:

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              // Prefer `dart-sass`, even if `sass-embedded` is available
              implementation: require("sass"),
            },
          },
        ],
      },
    ],
  },
};

string

For example, to use Dart Sass, you'd pass:

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              // Prefer `dart-sass`, even if `sass-embedded` is available
              implementation: require.resolve("sass"),
            },
          },
        ],
      },
    ],
  },
};

sassOptions

Type:

type sassOptions =
  | import("sass").LegacyOptions<"async">
  | ((
      content: string | Buffer,
      loaderContext: LoaderContext,
      meta: any,
    ) => import("sass").LegacyOptions<"async">);

Default: defaults values for Sass implementation

Options for Dart Sass or Node Sass implementation.

[!NOTE]

The charset option is true by default for dart-sass, we strongly discourage setting this to false, because webpack doesn't support files other than utf-8.

[!NOTE]

The syntax (new API, by default since 16 version)andindentedSyntax(old API) option isscssfor thescssextension,indentedfor thesassextension andcssfor thecss` extension.

[!NOTE]

Options such as data and file are unavailable and will be ignored.

ℹ We strongly discourage changing the sourceMap (new API, by default since 16 version), outFile (old API), sourceMapContents (old API), sourceMapEmbed (old API), and sourceMapRoot (old API) options because sass-loader sets these automatically when the sourceMap option is true.

[!NOTE]

Access to the loader context inside the custom importer can be done using the this.webpackLoaderContext property.

There is a slight difference between the options for sass (dart-sass) and node-sass.

Please consult their respective documentation before using them:

object

Use an object for the Sass implementation setup.

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              sassOptions: {
                style: `compressed`,
                loadPaths: ["absolute/path/a", "absolute/path/b"],
              },
            },
          },
        ],
      },
    ],
  },
};

function

Allows configuring the Sass implementation with different options based on the loader context.

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 {
                    loadPaths: ["absolute/path/c", "absolute/path/d"],
                  };
                }

                return {
                  loadPaths: ["absolute/path/a", "absolute/path/b"],
                };
              },
            },
          },
        ],
      },
    ],
  },
};

sourceMap

Type:

type sourceMap = boolean;

Default: depends on the compiler.devtool value

Enables/Disables generation of source maps.

By default generation of source maps depends on the devtool option. All values enable source map generation except eval and false.

ℹ If true, the sourceMap (new API, by default since 16 version), outFile (old API), sourceMapContents (old API), sourceMapEmbed (old API), and sourceMapRoot (old API) from sassOptions will be ignored.

webpack.config.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

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:

type additionalData =
  | string
  | ((content: string | Buffer, loaderContext: LoaderContext) => string);

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

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
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
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:

type webpackImporter = boolean;

Default: true

Enables/Disables the default webpack importer.

This can improve performance in some cases, though use it with caution because aliases and @import at-rules starting with ~ will not work. You can pass your own importer to solve this (see importer docs).

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              webpackImporter: false,
            },
          },
        ],
      },
    ],
  },
};

warnRuleAsWarning

Type:

type warnRuleAsWarning = boolean;

Default: true

Treats the @warn rule as a webpack warning.

style.scss

$known-prefixes: webkit, moz, ms, o;

@mixin prefix($property, $value, $prefixes) {
  @each $prefix in $prefixes {
    @if not index($known-prefixes, $prefix) {
      @warn "Unknown prefix #{$prefix}.";
    }

    -#{$prefix}-#{$property}: $value;
  }
  #{$property}: $value;
}

.tilt {
  // Oops, we typo'd "webkit" as "wekbit"!
  @include prefix(transform, rotate(15deg), wekbit ms);
}

The presented code will throw a webpack warning instead logging.

To ignore unnecessary warnings you can use the ignoreWarnings option.

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              warnRuleAsWarning: true,
            },
          },
        ],
      },
    ],
  },
};

api

Type:

type api = "legacy" | "modern" | "modern-compiler";

Default: "modern" for sass (dart-sass) and sass-embedded, or "legacy" for node-sass

Allows you to switch between the legacy and modern APIs. You can find more information here. The modern-compiler option enables the modern API with support for Shared Resources.

[!NOTE]

Using modern-compiler and sass-embedded together significantly improve performance and decrease built time. We strongly recommend their use. We will enable them by default in a future major release.

[!WARNING]

The sass options are different for the legacy and modern APIs. Please look at docs how to migrate to the modern options.

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              api: "modern-compiler",
              sassOptions: {
                // Your sass options
              },
            },
          },
        ],
      },
    ],
  },
};

How to enable @debug output

By default, the output of @debug messages are disabled. Add the following to webpack.config.js to enable them:

module.exports = {
  stats: {
    loggingDebug: ["sass-loader"],
  },
  // ...
};

Examples

Extracts CSS into separate files

For production builds it's recommended to extract the CSS from your bundle to be able to use parallel loading of CSS/JS resources later on.

There are four recommended ways to extract a stylesheet from a bundle:

1. mini-css-extract-plugin

webpack.config.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",
    }),
  ],
};

2. Asset Modules

webpack.config.js

module.exports = {
  entry: [__dirname + "/src/scss/app.scss"],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [],
      },
      {
        test: /\.scss$/,
        exclude: /node_modules/,
        type: "asset/resource",
        generator: {
          filename: "bundle.css",
        },
        use: ["sass-loader"],
      },
    ],
  },
};

3. extract-loader (simpler, but specialized on the css-loader's output)

4. file-loader (deprecated--should only be used in webpack v4)

webpack.config.js

module.exports = {
  entry: [__dirname + "/src/scss/app.scss"],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [],
      },
      {
        test: /\.scss$/,
        exclude: /node_modules/,
        use: [
          {
            loader: "file-loader",
            options: { outputPath: "css/", name: "[name].min.css" },
          },
          "sass-loader",
        ],
      },
    ],
  },
};

(source: https://stackoverflow.com/a/60029923/2969615)

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

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. Checkout test/sourceMap for a running example.

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

16.0.5 (2025-02-14)

Bug Fixes

  • allow to import CSS using @use with css extension (#1254) (3352e49)

16.0.4 (2024-12-04)

Bug Fixes

  • include sources map сontent for modern api by default (#1250) (70a10ff)

16.0.3 (2024-11-01)

Bug Fixes

  • modern-compiler: dispose redundant compilers (#1245) (004ed38)

16.0.2 (2024-09-20)

Bug Fixes

16.0.1 (2024-08-19)

Bug Fixes

  • generate correct sourceMaps for modern-compiler api (#1228) (f862f7a)

16.0.0 (2024-07-26)

⚠ BREAKING CHANGES

  • use modern Sass JS API by default for sass and sass-embedded

[!WARNING]

The sass options are different for the legacy (before) and modern APIs. Please look at docs how to migrate to the modern options. Legacy options - https://sass-lang.com/documentation/js-api/interfaces/legacystringoptions/ Modern options - https://sass-lang.com/documentation/js-api/interfaces/options/

To return to the previous logic use:

module.exports = {
  module: {
    rules: [
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "sass-loader",
            options: {
              api: "legacy",
              // Your options
            },
          },
        ],
      },
    ],
  },
};

Features

  • use modern Sass JS API by default for sass and sass-embedded (10be1ba)

15.0.0 (2024-07-23)

⚠ BREAKING CHANGES

  • prefer sass-embedded over sass by default (#1211)

Features

  • prefer sass-embedded over sass by default (#1211) (83423ff)

14.2.1 (2024-04-16)

Bug Fixes

14.2.0 (2024-04-11)

Features

  • added the modern-compiler value for API to reuse compiler process (#1195) (cef40a8)
  • support webpack built-in resolver for modern and modern-compiler API (#1197) (2265b72)

Notes:

Using the modern-compiler value for the api option together with sass-embedded reduces compilation time by 5-10 times, especially for projects using large files with a lot of @import/@use, for small files the build time reduction will not be significant.

14.1.1 (2024-02-19)

Bug Fixes

14.1.0 (2024-01-30)

Features

  • add @rspack/core as an optional peer dependency (#1184) (637ba5b)

14.0.0 (2024-01-15)

⚠ BREAKING CHANGES

  • removed fibers support
  • minimum supported Node.js version is 18.12.0 (627f55d)

13.3.3 (2023-12-25)

Bug Fixes

13.3.2 (2023-06-09)

Bug Fixes

  • perf: avoid using klona for sass options (#1145) (9e87b6b)

13.3.1 (2023-05-28)

Bug Fixes

13.3.0 (2023-05-22)

Features

13.2.2 (2023-03-27)

Bug Fixes

13.2.1 (2023-03-18)

Bug Fixes

  • do not crash on a custom scheme in @import/@use for the modern API (21966ee)

13.2.0 (2022-11-09)

Features

13.1.0 (2022-10-06)

Features

13.0.2 (2022-06-27)

Bug Fixes

13.0.1 (2022-06-24)

Bug Fixes

13.0.0 (2022-05-18)

⚠ BREAKING CHANGES

  • minimum supported Node.js version is 14.15.0 (#1048)
  • emit @warn at-rules as webpack warnings by default, if you want to revert behavior please use the warnRuleAsWarning option (#1054) (58ffb68)

Bug Fixes

  • do not crash on importers for modern API (#1052) (095814e)
  • do not store original sass error in webpack error(#1053) (06d7533)

12.6.0 (2022-02-15)

Features

  • added support for automatic loading of sass-embedded (#1025) (c8dae87)

12.5.0 (2022-02-14)

Features

  • added support for sass-embedded (faster than node-sass), feel free to feedback
  • added the api option (modern api is experimental and currently doesn't support built-in webpack resolver) (afbe114)

12.4.0 (2021-12-07)

Features

12.3.0 (2021-10-27)

Features

  • added the warnRuleAsWarning option, allows to emit a warning on the @warn rule (#992) (c652c79)
  • use webpack logger to log sass messages (only for dart-sass), configure it using infrastructureLogging (#991) (bb7cef9)

12.2.0 (2021-10-12)

Features

12.1.0 (2021-06-10)

Features

  • allow String value for the implementation option (382a3ca)

12.0.0 (2021-06-01)

⚠ BREAKING CHANGES

  • minimum supported Node.js version is 12.13.0

Bug Fixes

  • crash in custom importers with worker threads (#958) (67aa139)
  • resolving _index.import.scss/index.import.scss in packages (#906) (6641a16)

11.1.1 (2021-05-13)

Bug Fixes

  • disabled auto importing fiber on node >= 16 due incompatibility problems (#950) (4ca004b)

11.1.0 (2021-05-10)

Features

11.0.1 (2021-02-08)

Bug Fixes

  • compatibility with custom importers for node-sass (#927) (af5a072)

11.0.0 (2021-02-05)

Notes

  • using ~ is deprecated and can be removed from your code (we recommend it), but we still support it for historical reasons.

Why you can removed it? The loader will first try to resolve @import/@use as relative, if it cannot be resolved, the loader will try to resolve @import/@use inside node_modules. Using ~ means looking for files in node_modules or resolve.alias or resolve.fallback.

⚠ BREAKING CHANGES

  • minimum supported webpack version is 5

Features

  • supported the resolve.byDependency option, you can setup { resolve: { byDependency: { sass: { mainFiles: ['custom', '...'] } } } }

10.2.0 (2021-05-10)

Features

10.1.1 (2021-01-11)

Bug Fixes

  • problem with resolving and the includePaths option (#913) (cadc75e)

10.1.0 (2020-11-11)

Features

  • allow the additionalData to be async (#902) (9d925ff)

10.0.5 (2020-11-02)

Bug Fixes

10.0.4 (2020-10-22)

Bug Fixes

  • compatibility with the filesystem cache (#896) (e31f9b6)

10.0.3 (2020-10-09)

Chore

  • update schema-utils

10.0.2 (2020-09-03)

Bug Fixes

10.0.1 (2020-08-25)

Chore

  • update deps

10.0.0 (2020-08-24)

Bug Fixes

  • handle absolute windows path in source maps

10.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 (2020-08-05)

Bug Fixes

9.0.2 (2020-07-07)

Bug Fixes

9.0.1 (2020-07-03)

Bug Fixes

9.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
  • 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) (d487683)
  • supports for process.cwd() resolution logic by default (#837) (0c8d3b3)
  • supports for SASS-PATH env variable resolution logic by default (#836) (8376179)
  • supports for the sass property for the exports field from package.json (conditional exports, for more information read docs)

Bug Fixes

  • avoid different content on different os (#832) (68dd278)
  • resolution logic when the includePaths option used was improved (#827) (cbe5ad4)
  • resolution logic for file:// scheme was improved (17832fd)
  • resolution logic for absolute paths and server relative URLs was improved
  • source maps generation was improved

8.0.2 (2020-01-13)

Bug Fixes

8.0.1 (2020-01-10)

Bug Fixes

8.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) (96184e1)
  • source map generation depends on the devtool option (#743) (fcea88e)
  • validate loader options (#737) (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 (2019-08-20)

Bug Fixes

  • minimum node version in package.json (#733) (1175920)

7.3.0 (2019-08-20)

Bug Fixes

Features

7.2.0 (2019-08-08)

Bug Fixes

Features

  • allow passing functions option as function (#651) (6c9654d)
  • support data as Function (#648) (aa64e1b)
  • support sass and style fields in package.json (#647) (a8709c9)
  • support auto resolving dart-sass (ff90dd6)

7.1.0 (2018-08-01)

Features

  • Make this package implementation-agnostic (#573) (bed9fb5), closes #435

7.0.3 (2018-06-05)

Bug Fixes

  • Bare imports not working sometimes (#579) (c348281), closes #566

7.0.2 (2018-06-02)

Bug Fixes

  • Errors being swallowed when trying to load node-sass (#576) (6dfb274), closes #563
  • Report error to user for problems loading node-sass (#562) (2529c07)

7.0.1 (2018-04-13)

Bug Fixes

  • Wrong import precedence (#557) (f4eeff1)

7.0.0 (2018-04-13)

Features

  • Refactor resolving and simplify webpack config aliases (#479) (e0fde1a)
  • Remove node-sass from peerDependencies (#533) (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.

6.0.7 (2018-03-03)

Bug Fixes

  • package: add webpack >= v4.0.0 (peerDependencies) (#541) (620bdd4)

Performance Improvements

6.0.6 (2017-06-14)

Chore

  • Adds Webpack 3.x version range to peerDependencies

6.0.5 (2017-05-10)

Bug Fixes

  • importing file directly from scoped npm package #450 (5d06e9d)

6.0.4 (2017-05-09)

Bug Fixes

  • fix: Resolving of scoped npm packages #447

6.0.3 (2017-03-07)

Bug Fixes

  • Fix regression with empty files #398

Chore

  • Reduce npm package size by using the files property in the package.json

6.0.2 (2017-02-21)

Chore

  • Update dependencies #383

6.0.1 (2017-02-17)

Bug Fixes

  • Fix source maps in certain CWDs. #377

6.0.0 (2017-02-13)

Bug Fixes

  • Improve source map support. #374

BREAKING CHANGES

  • This is breaking for the resolve-url-loader

5.0.1 (2017-02-13)

Bug Fixes

  • Fix bug where multiple compilations interfered with each other. #369

5.0.0 (2017-02-13)

Code Refactoring

  • Remove synchronous compilation support #334

BREAKING CHANGES

4.1.1 (2016-12-21)

Chore

  • Update webpack peer dependency to support 2.2.0rc. #330

4.1.0 (2016-12-14)

Features

4.0.2 (2016-07-07)

Bug Fixes

  • Fix wrong context in customImporters #281

4.0.1 (2016-07-01)

Bug Fixes

  • Fix custom importers receiving 'stdin' as second argument instead of the actual resourcePath #267

4.0.0 (2016-06-27)

Bug Fixes

  • Fix incorrect source map paths #250

BREAKING CHANGES

3.2.2 (2016-06-26)

Bug Fixes

  • Fix incorrect source map paths #250

3.2.1 (2016-06-19)

Bug Fixes

  • Add webpack@^2.1.0-beta as peer dependency #233

3.2.0 (2016-03-12)

Features

  • Append file content instead of overwriting when data-option is already present #216
  • Make indentedSyntax option a bit smarter #196

3.1.2 (2015-11-22)

Bug Fixes

  • Fix loader query not overriding webpack config #189
  • Update peer-dependencies #182
    • node-sass^3.4.2
    • webpack^1.12.6

3.1.1 (2015-10-26)

Bug Fixes

  • Fix missing module object-assign #178

3.1.0 (2015-10-25)

Bug Fixes

  • Fix a problem where modules with a . in their names were not resolved #167

Features

  • Add possibility to also define all options in your webpack.config.js #152 #170

3.0.0 (2015-09-29)

Bug Fixes

  • Fix crash when Sass reported an error without file #158

BREAKING CHANGES

  • Add node-sass@^3.3.3 and webpack@^1.12.2 as peer-dependency #165 #166 #169

2.0.1 (2015-08-14)

Bug Fixes

  • Add missing path normalization (fixes #141)

2.0.0 (2015-08-06)

Bug Fixes

Code Refactoring

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 #138

1.0.4 (2015-08-03)

Bug Fixes

  • Fix wrong source-map urls #123
  • Include source-map contents by default #104

1.0.3 (2015-07-22)

Bug Fixes

  • Fix importing css files from scss/sass #101
  • Fix importing Sass partials from includePath #98 #110

1.0.2 (2015-04-15)

Bug Fixes

  • Fix a bug where files could not be imported across language styles #73
  • Update peer-dependency node-sass to 3.1.0

1.0.1 (2015-03-31)

Bug Fixes

  • Fix Sass partials not being resolved anymore #68
  • Update peer-dependency node-sass to 3.0.0-beta.4

1.0.0 (2015-03-22)

Bug Fixes

  • Moved node-sass^3.0.0-alpha.0 to peerDependencies #28
  • Using webpack's module resolver as custom importer #39
  • Add synchronous compilation support for usage with enhanced-require #39