diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f7cbce..8f3ab5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. Items under Contributors: please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version. +## [2.0.0.beta.17] - 2016-12-04 +##### Added +- Allow `styleLoaders` to depend on the environment variable `NODE_ENV` [#222](https://github.com/shakacode/bootstrap-loader/pull/222) by [bertho-zero](https://github.com/bertho-zero). + ## [2.0.0.beta.16] - 2016-11-23 ##### Fixed - Improved webpack performance. createUserImport should pass an absolute path to webpack.addDependency. [#212](https://github.com/shakacode/bootstrap-loader/pull/212) by [stephanwilliams](https://github.com/stephanwilliams). @@ -75,7 +79,8 @@ Changes from v1.1.1 to 2.0.0.beta.2 ## [1.0.8] -[Unreleased]: https://github.com/shakacode/bootstrap-loader/compare/2.0.0-beta.16...master +[Unreleased]: https://github.com/shakacode/bootstrap-loader/compare/2.0.0-beta.17...master +[2.0.0.beta.17]: https://github.com/shakacode/bootstrap-loader/compare/2.0.0-beta.16...2.0.0-beta.17 [2.0.0.beta.16]: https://github.com/shakacode/bootstrap-loader/compare/2.0.0-beta.15...2.0.0-beta.16 [2.0.0.beta.15]: https://github.com/shakacode/bootstrap-loader/compare/2.0.0-beta.14...2.0.0-beta.15 [2.0.0.beta.14]: https://github.com/shakacode/bootstrap-loader/compare/2.0.0-beta.13...2.0.0-beta.14 diff --git a/README.md b/README.md index 4fb32505..649c0772 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,23 @@ styleLoaders: - sass-loader?outputStyle=expanded ``` +Different settings for different environments can be used. +```yaml +# It depends on value of NODE_ENV environment variable +env: + development: + styleLoaders: + - style-loader + - css-loader + - resolve-url-loader + - sass-loader + production: + styleLoaders: + - style-loader + - css-loader + - sass-loader +``` + #### `extractStyles` Default: `false` diff --git a/package.json b/package.json index 1455c059..9eda26a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-loader", - "version": "2.0.0-beta.16", + "version": "2.0.0-beta.17", "description": "Boostrap for Webpack", "main": "loader.js", "scripts": { diff --git a/src/bootstrap.config.js b/src/bootstrap.config.js index cecb7dfc..4bd23113 100644 --- a/src/bootstrap.config.js +++ b/src/bootstrap.config.js @@ -101,7 +101,7 @@ export default function createConfig({ appStyles: defaultConfig.appStyles, useCustomIconFontPath: defaultConfig.useCustomIconFontPath, extractStyles: extractStyles || getEnvProp('extractStyles', defaultConfig), - styleLoaders: defaultConfig.styleLoaders, + styleLoaders: getEnvProp('styleLoaders', defaultConfig), styles: selectModules(defaultConfig.styles), scripts: selectModules(defaultConfig.scripts), configFilePath, @@ -135,7 +135,7 @@ export default function createConfig({ useFlexbox: userConfig.useFlexbox, useCustomIconFontPath: userConfig.useCustomIconFontPath, extractStyles: extractStyles || getEnvProp('extractStyles', userConfig), - styleLoaders: userConfig.styleLoaders, + styleLoaders: getEnvProp('styleLoaders', userConfig), styles: selectUserModules(userConfig.styles, defaultConfig.styles), scripts: selectUserModules(userConfig.scripts, defaultConfig.scripts), configFilePath,