-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Installs and adds sass loader task in webpack for dev environment. * Uses Timer's branch of sass-loader without node-sass dependency. * Adds method for handling SASS modules. * Fixes extension of excluded files when looking for scss modules. * Adds support for both .scss and .sass extensions. * Uses ExtractTextPlugin with sass-loader to bundle styles for the production build. * Bundles SASS modules for the production build. * Uses the latest version of sass-loader. * Adds function to create different rules for style loaders in dev environment. * Abstracts style loaders to a common function to avoid repetition. * Simplifies the common function that creates style loaders. * Creates assets for testing SASS/SCSS support. * Creates mock components and unit tests for SASS and SCSS with and without modules. * Creates integration tests for SASS/SCSS support. * Adds node-sass as a template dependency so sass-loader can be tested. * Includes sass tests when test component is mounted. * Fixes asserted module name for sass and scss modules tests. * Removes tests against css imports in SCSS and SASS files. * Updates sass-loader to v7. * Uses getCSSModuleLocalIdent from react-dev-utils. * Fixes tests to match the use of getCSSModuleLocalIdent. * Improves readability of getStyleLoader function. * Uses postcss after sass. * Refactors dev config to simplify common function for style loaders. * Refactors prod config to simplify common function for style loaders. * Use importLoaders config according to css-loader docs.
- Loading branch information
Showing
18 changed files
with
336 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/react-scripts/fixtures/kitchensink/src/features/webpack/SassInclusion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import './assets/sass-styles.sass'; | ||
|
||
export default () => <p id="feature-sass-inclusion">We love useless text.</p>; |
17 changes: 17 additions & 0 deletions
17
packages/react-scripts/fixtures/kitchensink/src/features/webpack/SassInclusion.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import SassInclusion from './SassInclusion'; | ||
|
||
describe('sass inclusion', () => { | ||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<SassInclusion />, div); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/react-scripts/fixtures/kitchensink/src/features/webpack/SassModulesInclusion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import styles from './assets/sass-styles.module.sass'; | ||
|
||
export default () => ( | ||
<p className={styles.sassModulesInclusion}>SASS Modules are working!</p> | ||
); |
Oops, something went wrong.
bf3d73c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 sass, finally!!