diff --git a/src/importsToResolve.js b/src/importsToResolve.js index 01e20edf..631e260e 100644 --- a/src/importsToResolve.js +++ b/src/importsToResolve.js @@ -19,34 +19,56 @@ function importsToResolve(url) { // @see https://github.com/webpack-contrib/sass-loader/issues/167 const ext = path.extname(request); + // In case there is module request, send this to webpack resolver if (matchModuleImport.test(url)) { return [request, url]; } - // libsass' import algorithm works like this: - - // 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). + // 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.dirname(request); + const basename = path.basename(request); + + // In case there is file extension: + // + // 1. Try to resolve `_` file. + // 2. Try to resolve file without `_`. + // 3. Send a original url to webpack resolver, maybe it is alias. if (['.scss', '.sass'].includes(ext)) { - return [request, url]; + return [`${dirname}/_${basename}`, `${dirname}/${basename}`, url]; } - // In case there is no file extension... - // - Prefer modules starting with '_'. - // - File extension precedence: .scss, .sass, .css. - const basename = path.basename(request); - + // In case there is no file extension and filename starts with `_`: + // + // 1. Try to resolve files with `scss`, `sass` and `css` extensions. + // 2. Try to resolve directory with `_index` or `index` filename. + // 3. Send a original url to webpack resolver, maybe it is alias. if (basename.charAt(0) === '_') { - return [`${request}.scss`, `${request}.sass`, `${request}.css`, url]; + return [ + `${request}.scss`, + `${request}.sass`, + `${request}.css`, + request, + url, + ]; } - const dirname = path.dirname(request); - + // In case there is no file extension and filename doesn't start with `_`: + // + // 1. Try to resolve file starts with `_` and with extensions + // 2. Try to resolve file with extensions + // 3. Try to resolve directory with `_index` or `index` filename. + // 4. Send a original url to webpack resolver, maybe it is alias. return [ `${dirname}/_${basename}.scss`, `${dirname}/_${basename}.sass`, @@ -54,6 +76,7 @@ function importsToResolve(url) { `${request}.scss`, `${request}.sass`, `${request}.css`, + request, url, ]; } diff --git a/src/index.js b/src/index.js index 9002136a..9cd37180 100644 --- a/src/index.js +++ b/src/index.js @@ -55,7 +55,8 @@ function loader(content) { // Supported since v4.36.0 if (hasGetResolve(self)) { resolve = this.getResolve({ - mainFields: ['sass', 'style', '...'], + mainFields: ['sass', 'style', 'main', '...'], + mainFiles: ['_index', 'index', '...'], extensions: ['.scss', '.sass', '.css', '...'], }); } diff --git a/test/__snapshots__/loader.test.js.snap b/test/__snapshots__/loader.test.js.snap index 96cc0afd..8857356f 100644 --- a/test/__snapshots__/loader.test.js.snap +++ b/test/__snapshots__/loader.test.js.snap @@ -282,6 +282,22 @@ exports[`loader should work and ignore all css "@import" at-rules (node-sass) (s exports[`loader should work and ignore all css "@import" at-rules (node-sass) (scss): warnings 1`] = `Array []`; +exports[`loader should work and use the "_index" file in package (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "_index" file in package (node-sass) (scss): warnings 1`] = `Array []`; + exports[`loader should work and use the "custom-sass" field (dart-sass) (sass): errors 1`] = `Array []`; exports[`loader should work and use the "custom-sass" field (dart-sass) (sass): warnings 1`] = `Array []`; @@ -298,21 +314,53 @@ exports[`loader should work and use the "custom-sass" field (node-sass) (scss): exports[`loader should work and use the "custom-sass" field (node-sass) (scss): warnings 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (dart-sass) (sass): errors 1`] = `Array []`; +exports[`loader should work and use the "index" file in package (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package (node-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (dart-sass) (sass): errors 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (dart-sass) (sass): warnings 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (dart-sass) (sass): warnings 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (dart-sass) (scss): errors 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (dart-sass) (scss): errors 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (dart-sass) (scss): warnings 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (dart-sass) (scss): warnings 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (node-sass) (sass): errors 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (node-sass) (sass): errors 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (node-sass) (sass): warnings 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (node-sass) (sass): warnings 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (node-sass) (scss): errors 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (node-sass) (scss): errors 1`] = `Array []`; -exports[`loader should work and use the "index" property in package (node-sass) (scss): warnings 1`] = `Array []`; +exports[`loader should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (node-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (node-sass) (scss): warnings 1`] = `Array []`; exports[`loader should work and use the "main" field (dart-sass) (sass): errors 1`] = `Array []`; @@ -330,6 +378,38 @@ exports[`loader should work and use the "main" field (node-sass) (scss): errors exports[`loader should work and use the "main" field (node-sass) (scss): warnings 1`] = `Array []`; +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value already in the "mainFields" resolve option (node-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (node-sass) (scss): warnings 1`] = `Array []`; + exports[`loader should work and use the "sass" field (dart-sass) (sass): errors 1`] = `Array []`; exports[`loader should work and use the "sass" field (dart-sass) (sass): warnings 1`] = `Array []`; @@ -362,6 +442,54 @@ exports[`loader should work and use the "style" field (node-sass) (scss): errors exports[`loader should work and use the "style" field (node-sass) (scss): warnings 1`] = `Array []`; +exports[`loader should work when "@import" at-rules starting with "_" (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules starting with "_" (node-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules with extensions (node-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (dart-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (dart-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (dart-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (dart-sass) (scss): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (node-sass) (sass): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (node-sass) (sass): warnings 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (node-sass) (scss): errors 1`] = `Array []`; + +exports[`loader should work when "@import" at-rules without extensions and do not start with "_" (node-sass) (scss): warnings 1`] = `Array []`; + exports[`loader should work when an "@import" at-rule from scoped npm packages (dart-sass) (sass): errors 1`] = `Array []`; exports[`loader should work when an "@import" at-rule from scoped npm packages (dart-sass) (sass): warnings 1`] = `Array []`; diff --git a/test/helpers/getPureCode.js b/test/helpers/getPureCode.js index b5a20516..ecf8dc13 100644 --- a/test/helpers/getPureCode.js +++ b/test/helpers/getPureCode.js @@ -12,8 +12,10 @@ function getPureCode(testId, options) { delete sassOptions.implementation; + const isSass = /\.sass$/i.test(testId); + if (sassOptions.data) { - sassOptions.indentedSyntax = /\.sass$/i.test(testId); + sassOptions.indentedSyntax = isSass; sassOptions.data = `$prepended-data: hotpink${ sassOptions.indentedSyntax ? '\n' : ';' }${os.EOL}${fs.readFileSync( @@ -38,6 +40,126 @@ function getPureCode(testId, options) { testFolder, 'node_modules/scss-package-with-index/index.scss' ); + const pathToSassPackageWithUnderscoreIndexFile = path.resolve( + testFolder, + 'node_modules/sass-package-with-underscore-index/_index.sass' + ); + const pathToSCSSPackageWithUnderscoreIndexFile = path.resolve( + testFolder, + 'node_modules/scss-package-with-underscore-index/_index.scss' + ); + const pathToSCSSUnderscoreDir = path.resolve( + testFolder, + 'scss/_underscore-dir/_index.scss' + ); + const pathToSCSSUnderscoreDir1 = path.resolve( + testFolder, + 'scss/_underscore-dir-1/index.scss' + ); + const pathToSCSSUnderscoreDir2 = path.resolve( + testFolder, + 'scss/_underscore-dir-2/_index.sass' + ); + const pathToSCSSUnderscoreDir3 = path.resolve( + testFolder, + 'scss/_underscore-dir-3/index.sass' + ); + // Avoid `.css` extensions because `node-sass` doesn't compile them + const pathToSCSSUnderscoreDir4 = path.resolve( + testFolder, + 'scss/_underscore-dir-4/_index' + ); + // Avoid `.css` extensions because `node-sass` doesn't compile them + const pathToSCSSUnderscoreDir5 = path.resolve( + testFolder, + 'scss/_underscore-dir-5/index' + ); + const pathToSassUnderscoreDir = path.resolve( + testFolder, + 'sass/_underscore-dir/_index.sass' + ); + const pathToSassUnderscoreDir1 = path.resolve( + testFolder, + 'sass/_underscore-dir-1/index.sass' + ); + const pathToSassUnderscoreDir2 = path.resolve( + testFolder, + 'sass/_underscore-dir-2/_index.scss' + ); + const pathToSassUnderscoreDir3 = path.resolve( + testFolder, + 'sass/_underscore-dir-3/index.scss' + ); + // Avoid `.css` extensions because `node-sass` doesn't compile them + const pathToSassUnderscoreDir4 = path.resolve( + testFolder, + 'sass/_underscore-dir-4/_index' + ); + // Avoid `.css` extensions because `node-sass` doesn't compile them + const pathToSassUnderscoreDir5 = path.resolve( + testFolder, + 'sass/_underscore-dir-5/index' + ); + const pathToSCSSWord6 = path.resolve(testFolder, 'scss/word-6/_index.scss'); + const pathToSCSSWord7 = path.resolve(testFolder, 'scss/word-7/index.scss'); + const pathToSCSSWord8 = path.resolve(testFolder, 'scss/word-8/index.sass'); + const pathToSCSSWord9 = path.resolve(testFolder, 'scss/word-9/index.sass'); + const pathToSCSSWord10 = path.resolve(testFolder, 'scss/word-10/_index'); + const pathToSCSSWord11 = path.resolve(testFolder, 'scss/word-11/index'); + const pathToSCSSDirectory6 = path.resolve( + testFolder, + 'scss/directory-6/file/_index.scss' + ); + const pathToSCSSDirectory7 = path.resolve( + testFolder, + 'scss/directory-7/file/index.scss' + ); + const pathToSCSSDirectory8 = path.resolve( + testFolder, + 'scss/directory-8/file/_index.sass' + ); + const pathToSCSSDirectory9 = path.resolve( + testFolder, + 'scss/directory-9/file/index.sass' + ); + const pathToSCSSDirectory10 = path.resolve( + testFolder, + 'scss/directory-10/file/index' + ); + const pathToSCSSDirectory11 = path.resolve( + testFolder, + 'scss/directory-11/file/index' + ); + const pathToSassWord6 = path.resolve(testFolder, 'sass/word-6/_index.sass'); + const pathToSassWord7 = path.resolve(testFolder, 'sass/word-7/index.sass'); + const pathToSassWord8 = path.resolve(testFolder, 'sass/word-8/index.scss'); + const pathToSassWord9 = path.resolve(testFolder, 'sass/word-9/index.scss'); + const pathToSassWord10 = path.resolve(testFolder, 'sass/word-10/_index'); + const pathToSassWord11 = path.resolve(testFolder, 'sass/word-11/index'); + const pathToSassDirectory6 = path.resolve( + testFolder, + 'sass/directory-6/file/_index.sass' + ); + const pathToSassDirectory7 = path.resolve( + testFolder, + 'sass/directory-7/file/index.sass' + ); + const pathToSassDirectory8 = path.resolve( + testFolder, + 'sass/directory-8/file/_index.scss' + ); + const pathToSassDirectory9 = path.resolve( + testFolder, + 'sass/directory-9/file/index.scss' + ); + const pathToSassDirectory10 = path.resolve( + testFolder, + 'sass/directory-10/file/index' + ); + const pathToSassDirectory11 = path.resolve( + testFolder, + 'sass/directory-11/file/index' + ); const pathToAlias = path.resolve( testFolder, path.extname(testId).slice(1), @@ -109,11 +231,386 @@ function getPureCode(testId, options) { }; } + if (url === '~sass-package-with-underscore-index') { + return { + file: pathToSassPackageWithUnderscoreIndexFile, + }; + } + if (url === '~scss-package-with-index') { return { file: pathToSCSSPackageWithIndexFile, }; } + + if (url === '~scss-package-with-underscore-index') { + return { + file: pathToSCSSPackageWithUnderscoreIndexFile, + }; + } + + // Fallback for `node-sass` what is not supported `index` and `_index` resolutions + if (!isSass) { + if ( + url === '_underscore-dir' || + url === './_underscore-dir' || + url === '../scss/_underscore-dir' + ) { + return { + file: pathToSCSSUnderscoreDir, + }; + } + + if ( + url === '_underscore-dir-1' || + url === './_underscore-dir-1' || + url === '../scss/_underscore-dir-1' + ) { + return { + file: pathToSCSSUnderscoreDir1, + }; + } + + if ( + url === '_underscore-dir-2' || + url === './_underscore-dir-2' || + url === '../scss/_underscore-dir-2' + ) { + return { + file: pathToSCSSUnderscoreDir2, + }; + } + + if ( + url === '_underscore-dir-3' || + url === './_underscore-dir-3' || + url === '../scss/_underscore-dir-3' + ) { + return { + file: pathToSCSSUnderscoreDir3, + }; + } + + if ( + url === '_underscore-dir-4' || + url === './_underscore-dir-4' || + url === '../scss/_underscore-dir-4' + ) { + return { + file: pathToSCSSUnderscoreDir4, + }; + } + + if ( + url === '_underscore-dir-5' || + url === './_underscore-dir-5' || + url === '../scss/_underscore-dir-5' + ) { + return { + file: pathToSCSSUnderscoreDir5, + }; + } + + if ( + url === 'word-6' || + url === './word-6' || + url === '../scss/word-6' + ) { + return { + file: pathToSCSSWord6, + }; + } + + if ( + url === 'word-7' || + url === './word-7' || + url === '../scss/word-7' + ) { + return { + file: pathToSCSSWord7, + }; + } + + if ( + url === 'word-8' || + url === './word-8' || + url === '../scss/word-8' + ) { + return { + file: pathToSCSSWord8, + }; + } + + if ( + url === 'word-9' || + url === './word-9' || + url === '../scss/word-9' + ) { + return { + file: pathToSCSSWord9, + }; + } + + if ( + url === 'word-10' || + url === './word-10' || + url === '../scss/word-10' + ) { + return { + file: pathToSCSSWord10, + }; + } + + if ( + url === 'word-11' || + url === './word-11' || + url === '../scss/word-11' + ) { + return { + file: pathToSCSSWord11, + }; + } + + if ( + url === 'directory-6/file' || + url === './directory-6/file' || + url === '../scss/directory-6/file' + ) { + return { + file: pathToSCSSDirectory6, + }; + } + + if ( + url === 'directory-7/file' || + url === './directory-7/file' || + url === '../scss/directory-7/file' + ) { + return { + file: pathToSCSSDirectory7, + }; + } + + if ( + url === 'directory-8/file' || + url === './directory-8/file' || + url === '../scss/directory-8/file' + ) { + return { + file: pathToSCSSDirectory8, + }; + } + + if ( + url === 'directory-9/file' || + url === './directory-9/file' || + url === '../scss/directory-9/file' + ) { + return { + file: pathToSCSSDirectory9, + }; + } + + if ( + url === 'directory-10/file' || + url === './directory-10/file' || + url === '../scss/directory-10/file' + ) { + return { + file: pathToSCSSDirectory10, + }; + } + + if ( + url === 'directory-11/file' || + url === './directory-11/file' || + url === '../scss/directory-11/file' + ) { + return { + file: pathToSCSSDirectory11, + }; + } + } else { + if ( + url === '_underscore-dir' || + url === './_underscore-dir' || + url === '../sass/_underscore-dir' + ) { + return { + file: pathToSassUnderscoreDir, + }; + } + + if ( + url === '_underscore-dir-1' || + url === './_underscore-dir-1' || + url === '../sass/_underscore-dir-1' + ) { + return { + file: pathToSassUnderscoreDir1, + }; + } + + if ( + url === '_underscore-dir-2' || + url === './_underscore-dir-2' || + url === '../sass/_underscore-dir-2' + ) { + return { + file: pathToSassUnderscoreDir2, + }; + } + + if ( + url === '_underscore-dir-3' || + url === './_underscore-dir-3' || + url === '../sass/_underscore-dir-3' + ) { + return { + file: pathToSassUnderscoreDir3, + }; + } + + if ( + url === '_underscore-dir-4' || + url === './_underscore-dir-4' || + url === '../sass/_underscore-dir-4' + ) { + return { + file: pathToSassUnderscoreDir4, + }; + } + + if ( + url === '_underscore-dir-5' || + url === './_underscore-dir-5' || + url === '../sass/_underscore-dir-5' + ) { + return { + file: pathToSassUnderscoreDir5, + }; + } + + if ( + url === 'word-6' || + url === './word-6' || + url === '../sass/word-6' + ) { + return { + file: pathToSassWord6, + }; + } + + if ( + url === 'word-7' || + url === './word-7' || + url === '../sass/word-7' + ) { + return { + file: pathToSassWord7, + }; + } + + if ( + url === 'word-8' || + url === './word-8' || + url === '../sass/word-8' + ) { + return { + file: pathToSassWord8, + }; + } + + if ( + url === 'word-9' || + url === './word-9' || + url === '../sass/word-9' + ) { + return { + file: pathToSassWord9, + }; + } + + if ( + url === 'word-10' || + url === './word-10' || + url === '../sass/word-10' + ) { + return { + file: pathToSassWord10, + }; + } + + if ( + url === 'word-11' || + url === './word-11' || + url === '../sass/word-11' + ) { + return { + file: pathToSassWord11, + }; + } + + if ( + url === 'directory-6/file' || + url === './directory-6/file' || + url === '../sass/directory-6/file' + ) { + return { + file: pathToSassDirectory6, + }; + } + + if ( + url === 'directory-7/file' || + url === './directory-7/file' || + url === '../sass/directory-7/file' + ) { + return { + file: pathToSassDirectory7, + }; + } + + if ( + url === 'directory-8/file' || + url === './directory-8/file' || + url === '../sass/directory-8/file' + ) { + return { + file: pathToSassDirectory8, + }; + } + + if ( + url === 'directory-9/file' || + url === './directory-9/file' || + url === '../sass/directory-9/file' + ) { + return { + file: pathToSassDirectory9, + }; + } + + if ( + url === 'directory-10/file' || + url === './directory-10/file' || + url === '../sass/directory-10/file' + ) { + return { + file: pathToSassDirectory10, + }; + } + + if ( + url === 'directory-11/file' || + url === './directory-11/file' || + url === '../sass/directory-11/file' + ) { + return { + file: pathToSassDirectory11, + }; + } + } } // eslint-disable-next-line no-param-reassign diff --git a/test/loader.test.js b/test/loader.test.js index 27101841..40c33585 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -265,6 +265,48 @@ describe('loader', () => { expect(stats.compilation.errors).toMatchSnapshot('errors'); }); + it(`should work when "@import" at-rules with extensions (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-with-extension', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { loader: { options } }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + + it(`should work when "@import" at-rules starting with "_" (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-with-underscore', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { loader: { options } }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + + it(`should work when "@import" at-rules without extensions and do not start with "_" (${implementationName}) (${syntax})`, async () => { + const testId = getTestId( + 'import-without-extension-and-underscore', + syntax + ); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { loader: { options } }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + it(`should work and use the "sass" field (${implementationName}) (${syntax})`, async () => { const testId = getTestId('import-sass-field', syntax); const options = { @@ -304,6 +346,36 @@ describe('loader', () => { expect(stats.compilation.errors).toMatchSnapshot('errors'); }); + it(`should work and use the "main" field when the "main" value is not in the "mainFields" resolve option (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-main-field', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { + loader: { options, resolve: { mainFields: [] } }, + }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + + it(`should work and use the "main" field when the "main" value already in the "mainFields" resolve option (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-main-field', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { + loader: { options, resolve: { mainFields: ['main', '...'] } }, + }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + it(`should work and use the "custom-sass" field (${implementationName}) (${syntax})`, async () => { const testId = getTestId('import-custom-sass-field', syntax); const options = { @@ -319,11 +391,54 @@ describe('loader', () => { expect(stats.compilation.errors).toMatchSnapshot('errors'); }); - it(`should work and use the "index" property in package (${implementationName}) (${syntax})`, async () => { + it(`should work and use the "index" file in package (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-index', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { loader: { options } }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + + it(`should work and use the "index" file in package when the "index" value is not in the "mainFiles" resolve option (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-index', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; + const stats = await compile(testId, { + loader: { options, resolve: { mainFiles: [] } }, + }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + + it(`should work and use the "index" file in package when the "index" value already in the "mainFiles" resolve option (${implementationName}) (${syntax})`, async () => { const testId = getTestId('import-index', syntax); const options = { implementation: getImplementationByName(implementationName), }; + const stats = await compile(testId, { + loader: { options, resolve: { mainFiles: ['index', '...'] } }, + }); + + expect(getCode(stats).content).toBe(getPureCode(testId, options)); + + expect(stats.compilation.warnings).toMatchSnapshot('warnings'); + expect(stats.compilation.errors).toMatchSnapshot('errors'); + }); + + it(`should work and use the "_index" file in package (${implementationName}) (${syntax})`, async () => { + const testId = getTestId('import-_index', syntax); + const options = { + implementation: getImplementationByName(implementationName), + }; const stats = await compile(testId, { loader: { options } }); expect(getCode(stats).content).toBe(getPureCode(testId, options)); diff --git a/test/node_modules/sass-package-with-underscore-index/_index.sass b/test/node_modules/sass-package-with-underscore-index/_index.sass new file mode 100644 index 00000000..aabe2c18 --- /dev/null +++ b/test/node_modules/sass-package-with-underscore-index/_index.sass @@ -0,0 +1,2 @@ +a + color: red diff --git a/test/node_modules/scss-package-with-underscore-index/_index.scss b/test/node_modules/scss-package-with-underscore-index/_index.scss new file mode 100644 index 00000000..fdece7b4 --- /dev/null +++ b/test/node_modules/scss-package-with-underscore-index/_index.scss @@ -0,0 +1,3 @@ +a { + color: red; +} diff --git a/test/sass/_example-2.sass b/test/sass/_example-2.sass new file mode 100644 index 00000000..50043c99 --- /dev/null +++ b/test/sass/_example-2.sass @@ -0,0 +1,2 @@ +.example-2 + color: blue diff --git a/test/sass/_example-3.SASS b/test/sass/_example-3.SASS new file mode 100644 index 00000000..00d28267 --- /dev/null +++ b/test/sass/_example-3.SASS @@ -0,0 +1,2 @@ +.example-2 + color: black diff --git a/test/sass/_underscore-dir-1/index.sass b/test/sass/_underscore-dir-1/index.sass new file mode 100644 index 00000000..add11dfa --- /dev/null +++ b/test/sass/_underscore-dir-1/index.sass @@ -0,0 +1,2 @@ +.underscore-dir-1-index + color: goldenrod diff --git a/test/sass/_underscore-dir-2/_index.scss b/test/sass/_underscore-dir-2/_index.scss new file mode 100644 index 00000000..bca93144 --- /dev/null +++ b/test/sass/_underscore-dir-2/_index.scss @@ -0,0 +1,3 @@ +.underscore-dir-2-index { + color: mediumpurple; +} diff --git a/test/sass/_underscore-dir-3/index.scss b/test/sass/_underscore-dir-3/index.scss new file mode 100644 index 00000000..52766094 --- /dev/null +++ b/test/sass/_underscore-dir-3/index.scss @@ -0,0 +1,4 @@ +.underscore-dir-3-index { + color: bisque; +} + diff --git a/test/sass/_underscore-dir-4/_index.css b/test/sass/_underscore-dir-4/_index.css new file mode 100644 index 00000000..fb53ce04 --- /dev/null +++ b/test/sass/_underscore-dir-4/_index.css @@ -0,0 +1,3 @@ +.underscore-dir-4-index { + color: maroon; +} diff --git a/test/sass/_underscore-dir-5/index.css b/test/sass/_underscore-dir-5/index.css new file mode 100644 index 00000000..69c5ce54 --- /dev/null +++ b/test/sass/_underscore-dir-5/index.css @@ -0,0 +1,3 @@ +.underscore-dir-5-index { + color: magenta; +} diff --git a/test/sass/_underscore-dir/_index.sass b/test/sass/_underscore-dir/_index.sass new file mode 100644 index 00000000..5141075b --- /dev/null +++ b/test/sass/_underscore-dir/_index.sass @@ -0,0 +1,2 @@ +.underscore-dir-index + color: goldenrod diff --git a/test/sass/_underscore-file-1.sass b/test/sass/_underscore-file-1.sass new file mode 100644 index 00000000..6a9a21fb --- /dev/null +++ b/test/sass/_underscore-file-1.sass @@ -0,0 +1,2 @@ +.underscore-1 + color: cadetblue diff --git a/test/sass/_underscore-file-2.scss b/test/sass/_underscore-file-2.scss new file mode 100644 index 00000000..52c0ec81 --- /dev/null +++ b/test/sass/_underscore-file-2.scss @@ -0,0 +1,3 @@ +.underscore-2 { + color: azure; +} diff --git a/test/sass/_underscore-file-3.css b/test/sass/_underscore-file-3.css new file mode 100644 index 00000000..c7c32e7e --- /dev/null +++ b/test/sass/_underscore-file-3.css @@ -0,0 +1,3 @@ +.underscore-3 { + color: chocolate; +} diff --git a/test/sass/_underscore-file.sass b/test/sass/_underscore-file.sass new file mode 100644 index 00000000..3a742217 --- /dev/null +++ b/test/sass/_underscore-file.sass @@ -0,0 +1,2 @@ +.underscore + color: greenyellow diff --git a/test/sass/_word-1.scss b/test/sass/_word-1.scss new file mode 100644 index 00000000..18b2148d --- /dev/null +++ b/test/sass/_word-1.scss @@ -0,0 +1,3 @@ +.word-1 { + color: black; +} diff --git a/test/sass/_word-2.css b/test/sass/_word-2.css new file mode 100644 index 00000000..8d9432e7 --- /dev/null +++ b/test/sass/_word-2.css @@ -0,0 +1,3 @@ +.word-2 { + color: aquamarine; +} diff --git a/test/sass/_word.sass b/test/sass/_word.sass new file mode 100644 index 00000000..0f0934c4 --- /dev/null +++ b/test/sass/_word.sass @@ -0,0 +1,2 @@ +.word + color: red diff --git a/test/sass/directory-1/file.sass b/test/sass/directory-1/file.sass new file mode 100644 index 00000000..e648aef9 --- /dev/null +++ b/test/sass/directory-1/file.sass @@ -0,0 +1,2 @@ +.directory-1-file + color: #000066 diff --git a/test/sass/directory-10/file/_index.css b/test/sass/directory-10/file/_index.css new file mode 100644 index 00000000..25209b13 --- /dev/null +++ b/test/sass/directory-10/file/_index.css @@ -0,0 +1,3 @@ +.directory-10-file { + color: #bbb; +} diff --git a/test/sass/directory-11/file/index.css b/test/sass/directory-11/file/index.css new file mode 100644 index 00000000..39247396 --- /dev/null +++ b/test/sass/directory-11/file/index.css @@ -0,0 +1,3 @@ +.directory-10-file { + color: #ccb; +} diff --git a/test/sass/directory-2/_file.scss b/test/sass/directory-2/_file.scss new file mode 100644 index 00000000..258ea2e3 --- /dev/null +++ b/test/sass/directory-2/_file.scss @@ -0,0 +1,3 @@ +.directory-2-file { + color: #7f7f7f; +} diff --git a/test/sass/directory-3/file.scss b/test/sass/directory-3/file.scss new file mode 100644 index 00000000..bd376ee5 --- /dev/null +++ b/test/sass/directory-3/file.scss @@ -0,0 +1,3 @@ +.directory-3-file { + color: #7ff; +} diff --git a/test/sass/directory-4/_file.css b/test/sass/directory-4/_file.css new file mode 100644 index 00000000..7de4a4db --- /dev/null +++ b/test/sass/directory-4/_file.css @@ -0,0 +1,3 @@ +.directory-4-file { + color: #77ffff; +} diff --git a/test/sass/directory-5/file.css b/test/sass/directory-5/file.css new file mode 100644 index 00000000..752d87b1 --- /dev/null +++ b/test/sass/directory-5/file.css @@ -0,0 +1,3 @@ +.directory-4-file { + color: #777; +} diff --git a/test/sass/directory-6/file/_index.sass b/test/sass/directory-6/file/_index.sass new file mode 100644 index 00000000..94d9525a --- /dev/null +++ b/test/sass/directory-6/file/_index.sass @@ -0,0 +1,2 @@ +.directory-6-file + color: #faf diff --git a/test/sass/directory-7/file/index.sass b/test/sass/directory-7/file/index.sass new file mode 100644 index 00000000..bcb6c078 --- /dev/null +++ b/test/sass/directory-7/file/index.sass @@ -0,0 +1,2 @@ +.directory-7-file + color: #afa diff --git a/test/sass/directory-8/file/_index.scss b/test/sass/directory-8/file/_index.scss new file mode 100644 index 00000000..d7418452 --- /dev/null +++ b/test/sass/directory-8/file/_index.scss @@ -0,0 +1,3 @@ +.directory-8-file { + color: #aaf; +} diff --git a/test/sass/directory-9/file/index.scss b/test/sass/directory-9/file/index.scss new file mode 100644 index 00000000..7dacff31 --- /dev/null +++ b/test/sass/directory-9/file/index.scss @@ -0,0 +1,3 @@ +.directory-9-file { + color: #ffa; +} diff --git a/test/sass/directory/_file.sass b/test/sass/directory/_file.sass new file mode 100644 index 00000000..8cf424d9 --- /dev/null +++ b/test/sass/directory/_file.sass @@ -0,0 +1,2 @@ +.directory-file + color: #000066 diff --git a/test/sass/example-1.SASS b/test/sass/example-1.SASS new file mode 100644 index 00000000..c5309121 --- /dev/null +++ b/test/sass/example-1.SASS @@ -0,0 +1,2 @@ +.example-1 + color: green diff --git a/test/sass/example.sass b/test/sass/example.sass new file mode 100644 index 00000000..9fc5d290 --- /dev/null +++ b/test/sass/example.sass @@ -0,0 +1,2 @@ +.example + color: red diff --git a/test/sass/import-_index.sass b/test/sass/import-_index.sass new file mode 100644 index 00000000..2f3a379a --- /dev/null +++ b/test/sass/import-_index.sass @@ -0,0 +1 @@ +@import "~sass-package-with-underscore-index" diff --git a/test/sass/import-with-extension.sass b/test/sass/import-with-extension.sass new file mode 100644 index 00000000..f092e19c --- /dev/null +++ b/test/sass/import-with-extension.sass @@ -0,0 +1,18 @@ +@import "example.sass" +@import "./example.sass" +@import "../sass/example.sass" +// TODO https://github.com/sass/dart-sass/issues/798#issuecomment-521229911 +// @import "example-1.SASS" +@import "example-2.sass" +@import "./example-2.sass" +@import "../sass/example-2.sass" +// TODO https://github.com/sass/dart-sass/issues/798#issuecomment-521229911 +// @import "example-3.SASS" +@import "nested/example-4.sass" +@import "./nested/example-4.sass" +@import "../sass/nested/example-4.sass" +@import "nested/example-5.sass" +@import "./nested/example-5.sass" +@import "../sass/nested/example-5.sass" +// TODO https://github.com/sass/dart-sass/issues/798#issuecomment-521229911 +// @import "nested/example-6.SASS"; diff --git a/test/sass/import-with-underscore.sass b/test/sass/import-with-underscore.sass new file mode 100644 index 00000000..bf4dee8b --- /dev/null +++ b/test/sass/import-with-underscore.sass @@ -0,0 +1,112 @@ +@import "_underscore-file" +@import "underscore-file" +@import "./_underscore-file" +@import "./underscore-file" +@import "../sass/_underscore-file" +@import "../sass/underscore-file" +@import "_underscore-file.sass" +@import "./_underscore-file.sass" +@import "../sass/_underscore-file.sass" +@import "../sass/underscore-file.sass" +// SASS +@import "_underscore-file-1" +@import "underscore-file-1" +@import "./_underscore-file-1" +@import "./underscore-file-1" +@import "../sass/_underscore-file-1" +@import "../sass/underscore-file-1" +@import "_underscore-file-1.sass" +@import "underscore-file-1.sass" +@import "./_underscore-file-1.sass" +@import "./underscore-file-1.sass" +@import "../sass/_underscore-file-1.sass" +@import "../sass/underscore-file-1.sass" +// SCSS +@import "_underscore-file-2" +@import "underscore-file-2" +@import "./_underscore-file-2" +@import "./underscore-file-2" +@import "../sass/_underscore-file-2" +@import "../sass/underscore-file-2" +@import "_underscore-file-2.scss" +@import "underscore-file-2.scss" +@import "./_underscore-file-2.scss" +@import "./underscore-file-2.scss" +@import "../sass/_underscore-file-2.scss" +@import "../sass/underscore-file-2.scss" +// CSS +@import "_underscore-file-3" +@import "underscore-file-3" +@import "./_underscore-file-3" +@import "./underscore-file-3" +@import "../sass/_underscore-file-3" +@import "../sass/underscore-file-3" +// underscore index SASS +@import "_underscore-dir" +@import "./_underscore-dir" +@import "../sass/_underscore-dir" +@import "_underscore-dir/_index" +@import "./_underscore-dir/_index" +@import "../sass/_underscore-dir/_index" +@import "_underscore-dir/_index.sass" +@import "./_underscore-dir/_index.sass" +@import "../sass/_underscore-dir/_index.sass" +@import "_underscore-dir/index" +@import "./_underscore-dir/index" +@import "../sass/_underscore-dir/index" +@import "_underscore-dir/index.sass" +@import "./_underscore-dir/index.sass" +@import "../sass/_underscore-dir/index.sass" +// index SASS +@import "_underscore-dir-1" +@import "./_underscore-dir-1" +@import "../sass/_underscore-dir-1" +@import "_underscore-dir-1/index" +@import "./_underscore-dir-1/index" +@import "../sass/_underscore-dir-1/index" +@import "_underscore-dir-1/index.sass" +@import "./_underscore-dir-1/index.sass" +@import "../sass/_underscore-dir-1/index.sass" +// underscore index SCSS +@import "_underscore-dir-2" +@import "./_underscore-dir-2" +@import "../sass/_underscore-dir-2" +@import "_underscore-dir-2/_index" +@import "./_underscore-dir-2/_index" +@import "../sass/_underscore-dir-2/_index" +@import "_underscore-dir-2/_index.scss" +@import "./_underscore-dir-2/_index.scss" +@import "../sass/_underscore-dir-2/_index.scss" +@import "_underscore-dir-2/index" +@import "./_underscore-dir-2/index" +@import "../sass/_underscore-dir-2/index" +@import "_underscore-dir-2/index.scss" +@import "./_underscore-dir-2/index.scss" +@import "../sass/_underscore-dir-2/index.scss" +// index SCSS +@import "_underscore-dir-3" +@import "./_underscore-dir-3" +@import "../sass/_underscore-dir-3" +@import "_underscore-dir-3/index" +@import "./_underscore-dir-3/index" +@import "../sass/_underscore-dir-3/index" +@import "_underscore-dir-3/index.scss" +@import "./_underscore-dir-3/index.scss" +@import "../sass/_underscore-dir-3/index.scss" +// underscore index CSS +@import "_underscore-dir-4" +@import "./_underscore-dir-4" +@import "../sass/_underscore-dir-4" +@import "_underscore-dir-4/_index" +@import "./_underscore-dir-4/_index" +@import "../sass/_underscore-dir-4/_index" +@import "_underscore-dir-4/index" +@import "./_underscore-dir-4/index" +@import "../sass/_underscore-dir-4/index" +// index CSS +@import "_underscore-dir-5" +@import "./_underscore-dir-5" +@import "../sass/_underscore-dir-5" +@import "_underscore-dir-5/index" +@import "./_underscore-dir-5/index" +@import "../sass/_underscore-dir-5/index" diff --git a/test/sass/import-without-extension-and-underscore.sass b/test/sass/import-without-extension-and-underscore.sass new file mode 100644 index 00000000..bbf6e0fd --- /dev/null +++ b/test/sass/import-without-extension-and-underscore.sass @@ -0,0 +1,75 @@ +// Filename +@import "word" +@import "./word" +@import "../sass/word" +@import "word-1" +@import "./word-1" +@import "../sass/word-1" +@import "word-2" +@import "./word-2" +@import "../sass/word-2" +@import "word-3" +@import "./word-3" +@import "../sass/word-3" +@import "word-4" +@import "./word-4" +@import "../sass/word-4" +@import "word-5" +@import "./word-5" +@import "../sass/word-5" +@import "word-6" +@import "./word-6" +@import "../sass/word-6" +@import "word-7" +@import "./word-7" +@import "../sass/word-7" +@import "word-8" +@import "./word-8" +@import "../sass/word-8" +@import "word-9" +@import "./word-9" +@import "../sass/word-9" +@import "word-10" +@import "./word-10" +@import "../sass/word-10" +@import "word-11" +@import "./word-11" +@import "../sass/word-11" +// Directory/filename +@import 'directory/file' +@import './directory/file' +@import '../sass/directory/file' +@import 'directory-1/file' +@import './directory-1/file' +@import '../sass/directory-1/file' +@import 'directory-2/file' +@import './directory-2/file' +@import '../sass/directory-2/file' +@import 'directory-3/file' +@import './directory-3/file' +@import '../sass/directory-3/file' +@import 'directory-4/file' +@import './directory-4/file' +@import '../sass/directory-4/file' +@import 'directory-5/file' +@import './directory-5/file' +@import '../sass/directory-5/file' +// Directory/filename with `_index` and `index` +@import 'directory-6/file' +@import './directory-6/file' +@import '../sass/directory-6/file' +@import 'directory-7/file' +@import './directory-7/file' +@import '../sass/directory-7/file' +@import 'directory-8/file' +@import './directory-8/file' +@import '../sass/directory-8/file' +@import 'directory-9/file' +@import './directory-9/file' +@import '../sass/directory-9/file' +@import 'directory-10/file' +@import './directory-10/file' +@import '../sass/directory-10/file' +@import 'directory-11/file' +@import './directory-11/file' +@import '../sass/directory-11/file' diff --git a/test/sass/nested/_example-5.sass b/test/sass/nested/_example-5.sass new file mode 100644 index 00000000..e91cac1a --- /dev/null +++ b/test/sass/nested/_example-5.sass @@ -0,0 +1,2 @@ +.example-5 + color: aquamarine diff --git a/test/sass/nested/example-4.sass b/test/sass/nested/example-4.sass new file mode 100644 index 00000000..83cd3d00 --- /dev/null +++ b/test/sass/nested/example-4.sass @@ -0,0 +1,2 @@ +.example-4 + color: greenyellow diff --git a/test/sass/nested/example-6.SASS b/test/sass/nested/example-6.SASS new file mode 100644 index 00000000..944b7a35 --- /dev/null +++ b/test/sass/nested/example-6.SASS @@ -0,0 +1,2 @@ +.example-6 + color: rosybrown diff --git a/test/sass/spec/.gitignore b/test/sass/spec/.gitignore deleted file mode 100644 index db8b4be7..00000000 --- a/test/sass/spec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Will be populated by npm pretest -*.css diff --git a/test/sass/spec/dart-sass/.gitignore b/test/sass/spec/dart-sass/.gitignore deleted file mode 100644 index db8b4be7..00000000 --- a/test/sass/spec/dart-sass/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Will be populated by npm pretest -*.css diff --git a/test/sass/spec/node-sass/.gitignore b/test/sass/spec/node-sass/.gitignore deleted file mode 100644 index db8b4be7..00000000 --- a/test/sass/spec/node-sass/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Will be populated by npm pretest -*.css diff --git a/test/sass/word-10/_index.css b/test/sass/word-10/_index.css new file mode 100644 index 00000000..142062d9 --- /dev/null +++ b/test/sass/word-10/_index.css @@ -0,0 +1,3 @@ +.word-10 { + color: #fff4c2; +} diff --git a/test/sass/word-11/index.css b/test/sass/word-11/index.css new file mode 100644 index 00000000..a7d5ad57 --- /dev/null +++ b/test/sass/word-11/index.css @@ -0,0 +1,3 @@ +.word-11 { + color: #008800; +} diff --git a/test/sass/word-3.sass b/test/sass/word-3.sass new file mode 100644 index 00000000..94c40d59 --- /dev/null +++ b/test/sass/word-3.sass @@ -0,0 +1,2 @@ +.word-3 + color: #000088 diff --git a/test/sass/word-4.scss b/test/sass/word-4.scss new file mode 100644 index 00000000..0082a21d --- /dev/null +++ b/test/sass/word-4.scss @@ -0,0 +1,3 @@ +.word-4 { + color: #aaaaaa; +} diff --git a/test/sass/word-5.css b/test/sass/word-5.css new file mode 100644 index 00000000..edc3fae0 --- /dev/null +++ b/test/sass/word-5.css @@ -0,0 +1,3 @@ +.word-5 { + color: fuchsia; +} diff --git a/test/sass/word-6/_index.sass b/test/sass/word-6/_index.sass new file mode 100644 index 00000000..431a9cc1 --- /dev/null +++ b/test/sass/word-6/_index.sass @@ -0,0 +1,2 @@ +.word-6 + color: azure diff --git a/test/sass/word-7/index.sass b/test/sass/word-7/index.sass new file mode 100644 index 00000000..a1e9fbac --- /dev/null +++ b/test/sass/word-7/index.sass @@ -0,0 +1,2 @@ +.word-7 + color: red diff --git a/test/sass/word-8/_index.scss b/test/sass/word-8/_index.scss new file mode 100644 index 00000000..3200bf43 --- /dev/null +++ b/test/sass/word-8/_index.scss @@ -0,0 +1,3 @@ +.word-8 { + color: moccasin; +} diff --git a/test/sass/word-9/index.scss b/test/sass/word-9/index.scss new file mode 100644 index 00000000..baaf6318 --- /dev/null +++ b/test/sass/word-9/index.scss @@ -0,0 +1,3 @@ +.word-9 { + color: darkcyan; +} diff --git a/test/scss/_example-2.scss b/test/scss/_example-2.scss new file mode 100644 index 00000000..8f9c8fca --- /dev/null +++ b/test/scss/_example-2.scss @@ -0,0 +1,3 @@ +.example-2 { + color: blue; +} diff --git a/test/scss/_example-3.SCSS b/test/scss/_example-3.SCSS new file mode 100644 index 00000000..2190cfac --- /dev/null +++ b/test/scss/_example-3.SCSS @@ -0,0 +1,3 @@ +.example-2 { + color: black; +} diff --git a/test/scss/_underscore-dir-1/index.scss b/test/scss/_underscore-dir-1/index.scss new file mode 100644 index 00000000..a0120041 --- /dev/null +++ b/test/scss/_underscore-dir-1/index.scss @@ -0,0 +1,3 @@ +.underscore-dir-1-index { + color: goldenrod; +} diff --git a/test/scss/_underscore-dir-2/_index.sass b/test/scss/_underscore-dir-2/_index.sass new file mode 100644 index 00000000..829fb853 --- /dev/null +++ b/test/scss/_underscore-dir-2/_index.sass @@ -0,0 +1,2 @@ +.underscore-dir-2-index + color: mediumpurple diff --git a/test/scss/_underscore-dir-3/index.sass b/test/scss/_underscore-dir-3/index.sass new file mode 100644 index 00000000..3cc6baea --- /dev/null +++ b/test/scss/_underscore-dir-3/index.sass @@ -0,0 +1,3 @@ +.underscore-dir-3-index + color: bisque + diff --git a/test/scss/_underscore-dir-4/_index.css b/test/scss/_underscore-dir-4/_index.css new file mode 100644 index 00000000..fb53ce04 --- /dev/null +++ b/test/scss/_underscore-dir-4/_index.css @@ -0,0 +1,3 @@ +.underscore-dir-4-index { + color: maroon; +} diff --git a/test/scss/_underscore-dir-5/index.css b/test/scss/_underscore-dir-5/index.css new file mode 100644 index 00000000..69c5ce54 --- /dev/null +++ b/test/scss/_underscore-dir-5/index.css @@ -0,0 +1,3 @@ +.underscore-dir-5-index { + color: magenta; +} diff --git a/test/scss/_underscore-dir/_index.scss b/test/scss/_underscore-dir/_index.scss new file mode 100644 index 00000000..401661b4 --- /dev/null +++ b/test/scss/_underscore-dir/_index.scss @@ -0,0 +1,3 @@ +.underscore-dir-index { + color: goldenrod; +} diff --git a/test/scss/_underscore-file-1.scss b/test/scss/_underscore-file-1.scss new file mode 100644 index 00000000..eea5f86f --- /dev/null +++ b/test/scss/_underscore-file-1.scss @@ -0,0 +1,3 @@ +.underscore-1 { + color: cadetblue; +} diff --git a/test/scss/_underscore-file-2.sass b/test/scss/_underscore-file-2.sass new file mode 100644 index 00000000..995046db --- /dev/null +++ b/test/scss/_underscore-file-2.sass @@ -0,0 +1,2 @@ +.underscore-2 + color: azure diff --git a/test/scss/_underscore-file-3.css b/test/scss/_underscore-file-3.css new file mode 100644 index 00000000..c7c32e7e --- /dev/null +++ b/test/scss/_underscore-file-3.css @@ -0,0 +1,3 @@ +.underscore-3 { + color: chocolate; +} diff --git a/test/scss/_underscore-file.scss b/test/scss/_underscore-file.scss new file mode 100644 index 00000000..47e4a109 --- /dev/null +++ b/test/scss/_underscore-file.scss @@ -0,0 +1,3 @@ +.underscore { + color: greenyellow; +} diff --git a/test/scss/_word-1.sass b/test/scss/_word-1.sass new file mode 100644 index 00000000..80f6082c --- /dev/null +++ b/test/scss/_word-1.sass @@ -0,0 +1,2 @@ +.word-1 + color: black diff --git a/test/scss/_word-2.css b/test/scss/_word-2.css new file mode 100644 index 00000000..8d9432e7 --- /dev/null +++ b/test/scss/_word-2.css @@ -0,0 +1,3 @@ +.word-2 { + color: aquamarine; +} diff --git a/test/scss/_word.scss b/test/scss/_word.scss new file mode 100644 index 00000000..878d700b --- /dev/null +++ b/test/scss/_word.scss @@ -0,0 +1,3 @@ +.word { + color: red; +} diff --git a/test/scss/directory-1/file.scss b/test/scss/directory-1/file.scss new file mode 100644 index 00000000..d8753682 --- /dev/null +++ b/test/scss/directory-1/file.scss @@ -0,0 +1,3 @@ +.directory-1-file { + color: #000066; +} diff --git a/test/scss/directory-10/file/_index.css b/test/scss/directory-10/file/_index.css new file mode 100644 index 00000000..25209b13 --- /dev/null +++ b/test/scss/directory-10/file/_index.css @@ -0,0 +1,3 @@ +.directory-10-file { + color: #bbb; +} diff --git a/test/scss/directory-11/file/index.css b/test/scss/directory-11/file/index.css new file mode 100644 index 00000000..39247396 --- /dev/null +++ b/test/scss/directory-11/file/index.css @@ -0,0 +1,3 @@ +.directory-10-file { + color: #ccb; +} diff --git a/test/scss/directory-2/_file.sass b/test/scss/directory-2/_file.sass new file mode 100644 index 00000000..7e0a5410 --- /dev/null +++ b/test/scss/directory-2/_file.sass @@ -0,0 +1,2 @@ +.directory-2-file + color: #7f7f7f diff --git a/test/scss/directory-3/file.sass b/test/scss/directory-3/file.sass new file mode 100644 index 00000000..304e0699 --- /dev/null +++ b/test/scss/directory-3/file.sass @@ -0,0 +1,2 @@ +.directory-3-file + color: #7ff diff --git a/test/scss/directory-4/_file.css b/test/scss/directory-4/_file.css new file mode 100644 index 00000000..7de4a4db --- /dev/null +++ b/test/scss/directory-4/_file.css @@ -0,0 +1,3 @@ +.directory-4-file { + color: #77ffff; +} diff --git a/test/scss/directory-5/file.css b/test/scss/directory-5/file.css new file mode 100644 index 00000000..752d87b1 --- /dev/null +++ b/test/scss/directory-5/file.css @@ -0,0 +1,3 @@ +.directory-4-file { + color: #777; +} diff --git a/test/scss/directory-6/file/_index.scss b/test/scss/directory-6/file/_index.scss new file mode 100644 index 00000000..1f7c60be --- /dev/null +++ b/test/scss/directory-6/file/_index.scss @@ -0,0 +1,3 @@ +.directory-6-file { + color: #faf; +} diff --git a/test/scss/directory-7/file/index.scss b/test/scss/directory-7/file/index.scss new file mode 100644 index 00000000..a2422990 --- /dev/null +++ b/test/scss/directory-7/file/index.scss @@ -0,0 +1,3 @@ +.directory-7-file { + color: #afa; +} diff --git a/test/scss/directory-8/file/_index.sass b/test/scss/directory-8/file/_index.sass new file mode 100644 index 00000000..bede5b0d --- /dev/null +++ b/test/scss/directory-8/file/_index.sass @@ -0,0 +1,2 @@ +.directory-8-file + color: #aaf diff --git a/test/scss/directory-9/file/index.sass b/test/scss/directory-9/file/index.sass new file mode 100644 index 00000000..0314d47b --- /dev/null +++ b/test/scss/directory-9/file/index.sass @@ -0,0 +1,2 @@ +.directory-9-file + color: #ffa diff --git a/test/scss/directory/_file.scss b/test/scss/directory/_file.scss new file mode 100644 index 00000000..33dc9072 --- /dev/null +++ b/test/scss/directory/_file.scss @@ -0,0 +1,3 @@ +.directory-file { + color: #000066; +} diff --git a/test/scss/example-1.SCSS b/test/scss/example-1.SCSS new file mode 100644 index 00000000..279069b4 --- /dev/null +++ b/test/scss/example-1.SCSS @@ -0,0 +1,3 @@ +.example-1 { + color: green; +} diff --git a/test/scss/example.scss b/test/scss/example.scss new file mode 100644 index 00000000..f845c166 --- /dev/null +++ b/test/scss/example.scss @@ -0,0 +1,3 @@ +.example { + color: red; +} diff --git a/test/scss/import-_index.scss b/test/scss/import-_index.scss new file mode 100644 index 00000000..38f76fed --- /dev/null +++ b/test/scss/import-_index.scss @@ -0,0 +1 @@ +@import "~scss-package-with-underscore-index"; diff --git a/test/scss/import-with-extension.scss b/test/scss/import-with-extension.scss new file mode 100644 index 00000000..4c27ba81 --- /dev/null +++ b/test/scss/import-with-extension.scss @@ -0,0 +1,18 @@ +@import "example.scss"; +@import "./example.scss"; +@import "../scss/example.scss"; +// TODO https://github.com/sass/dart-sass/issues/798#issuecomment-521229911 +// @import "example-1.SCSS"; +@import "example-2.scss"; +@import "./example-2.scss"; +@import "../scss/example-2.scss"; +// TODO https://github.com/sass/dart-sass/issues/798#issuecomment-521229911 +// @import "example-3.SCSS"; +@import "nested/example-4.scss"; +@import "./nested/example-4.scss"; +@import "../scss/nested/example-4.scss"; +@import "nested/example-5.scss"; +@import "./nested/example-5.scss"; +@import "../scss/nested/example-5.scss"; +// TODO https://github.com/sass/dart-sass/issues/798#issuecomment-521229911 +// @import "nested/example-6.SCSS"; diff --git a/test/scss/import-with-underscore.scss b/test/scss/import-with-underscore.scss new file mode 100644 index 00000000..a148f4d1 --- /dev/null +++ b/test/scss/import-with-underscore.scss @@ -0,0 +1,112 @@ +@import "_underscore-file"; +@import "underscore-file"; +@import "./_underscore-file"; +@import "./underscore-file"; +@import "../scss/_underscore-file"; +@import "../scss/underscore-file"; +@import "_underscore-file.scss"; +@import "./_underscore-file.scss"; +@import "../scss/_underscore-file.scss"; +@import "../scss/underscore-file.scss"; +// SCSS +@import "_underscore-file-1"; +@import "underscore-file-1"; +@import "./_underscore-file-1"; +@import "./underscore-file-1"; +@import "../scss/_underscore-file-1"; +@import "../scss/underscore-file-1"; +@import "_underscore-file-1.scss"; +@import "underscore-file-1.scss"; +@import "./_underscore-file-1.scss"; +@import "./underscore-file-1.scss"; +@import "../scss/_underscore-file-1.scss"; +@import "../scss/underscore-file-1.scss"; +// SASS +@import "_underscore-file-2"; +@import "underscore-file-2"; +@import "./_underscore-file-2"; +@import "./underscore-file-2"; +@import "../scss/_underscore-file-2"; +@import "../scss/underscore-file-2"; +@import "_underscore-file-2.sass"; +@import "underscore-file-2.sass"; +@import "./_underscore-file-2.sass"; +@import "./underscore-file-2.sass"; +@import "../scss/_underscore-file-2.sass"; +@import "../scss/underscore-file-2.sass"; +// CSS +@import "_underscore-file-3"; +@import "underscore-file-3"; +@import "./_underscore-file-3"; +@import "./underscore-file-3"; +@import "../scss/_underscore-file-3"; +@import "../scss/underscore-file-3"; +// underscore index SCSS +@import "_underscore-dir"; +@import "./_underscore-dir"; +@import "../scss/_underscore-dir"; +@import "_underscore-dir/_index"; +@import "./_underscore-dir/_index"; +@import "../scss/_underscore-dir/_index"; +@import "_underscore-dir/_index.scss"; +@import "./_underscore-dir/_index.scss"; +@import "../scss/_underscore-dir/_index.scss"; +@import "_underscore-dir/index"; +@import "./_underscore-dir/index"; +@import "../scss/_underscore-dir/index"; +@import "_underscore-dir/index.scss"; +@import "./_underscore-dir/index.scss"; +@import "../scss/_underscore-dir/index.scss"; +// index SCSS +@import "_underscore-dir-1"; +@import "./_underscore-dir-1"; +@import "../scss/_underscore-dir-1"; +@import "_underscore-dir-1/index"; +@import "./_underscore-dir-1/index"; +@import "../scss/_underscore-dir-1/index"; +@import "_underscore-dir-1/index.scss"; +@import "./_underscore-dir-1/index.scss"; +@import "../scss/_underscore-dir-1/index.scss"; +// underscore index SASS +@import "_underscore-dir-2"; +@import "./_underscore-dir-2"; +@import "../scss/_underscore-dir-2"; +@import "_underscore-dir-2/_index"; +@import "./_underscore-dir-2/_index"; +@import "../scss/_underscore-dir-2/_index"; +@import "_underscore-dir-2/_index.sass"; +@import "./_underscore-dir-2/_index.sass"; +@import "../scss/_underscore-dir-2/_index.sass"; +@import "_underscore-dir-2/index"; +@import "./_underscore-dir-2/index"; +@import "../scss/_underscore-dir-2/index"; +@import "_underscore-dir-2/index.sass"; +@import "./_underscore-dir-2/index.sass"; +@import "../scss/_underscore-dir-2/index.sass"; +// index SASS +@import "_underscore-dir-3"; +@import "./_underscore-dir-3"; +@import "../scss/_underscore-dir-3"; +@import "_underscore-dir-3/index"; +@import "./_underscore-dir-3/index"; +@import "../scss/_underscore-dir-3/index"; +@import "_underscore-dir-3/index.sass"; +@import "./_underscore-dir-3/index.sass"; +@import "../scss/_underscore-dir-3/index.sass"; +// underscore index CSS +@import "_underscore-dir-4"; +@import "./_underscore-dir-4"; +@import "../scss/_underscore-dir-4"; +@import "_underscore-dir-4/_index"; +@import "./_underscore-dir-4/_index"; +@import "../scss/_underscore-dir-4/_index"; +@import "_underscore-dir-4/index"; +@import "./_underscore-dir-4/index"; +@import "../scss/_underscore-dir-4/index"; +// index CSS +@import "_underscore-dir-5"; +@import "./_underscore-dir-5"; +@import "../scss/_underscore-dir-5"; +@import "_underscore-dir-5/index"; +@import "./_underscore-dir-5/index"; +@import "../scss/_underscore-dir-5/index"; diff --git a/test/scss/import-without-extension-and-underscore.scss b/test/scss/import-without-extension-and-underscore.scss new file mode 100644 index 00000000..eced83b6 --- /dev/null +++ b/test/scss/import-without-extension-and-underscore.scss @@ -0,0 +1,75 @@ +// Filename +@import "word"; +@import "./word"; +@import "../scss/word"; +@import "word-1"; +@import "./word-1"; +@import "../scss/word-1"; +@import "word-2"; +@import "./word-2"; +@import "../scss/word-2"; +@import "word-3"; +@import "./word-3"; +@import "../scss/word-3"; +@import "word-4"; +@import "./word-4"; +@import "../scss/word-4"; +@import "word-5"; +@import "./word-5"; +@import "../scss/word-5"; +@import "word-6"; +@import "./word-6"; +@import "../scss/word-6"; +@import "word-7"; +@import "./word-7"; +@import "../scss/word-7"; +@import "word-8"; +@import "./word-8"; +@import "../scss/word-8"; +@import "word-9"; +@import "./word-9"; +@import "../scss/word-9"; +@import "word-10"; +@import "./word-10"; +@import "../scss/word-10"; +@import "word-11"; +@import "./word-11"; +@import "../scss/word-11"; +// Directory/filename +@import 'directory/file'; +@import './directory/file'; +@import '../scss/directory/file'; +@import 'directory-1/file'; +@import './directory-1/file'; +@import '../scss/directory-1/file'; +@import 'directory-2/file'; +@import './directory-2/file'; +@import '../scss/directory-2/file'; +@import 'directory-3/file'; +@import './directory-3/file'; +@import '../scss/directory-3/file'; +@import 'directory-4/file'; +@import './directory-4/file'; +@import '../scss/directory-4/file'; +@import 'directory-5/file'; +@import './directory-5/file'; +@import '../scss/directory-5/file'; +// Directory/filename with `_index` and `index` +@import 'directory-6/file'; +@import './directory-6/file'; +@import '../scss/directory-6/file'; +@import 'directory-7/file'; +@import './directory-7/file'; +@import '../scss/directory-7/file'; +@import 'directory-8/file'; +@import './directory-8/file'; +@import '../scss/directory-8/file'; +@import 'directory-9/file'; +@import './directory-9/file'; +@import '../scss/directory-9/file'; +@import 'directory-10/file'; +@import './directory-10/file'; +@import '../scss/directory-10/file'; +@import 'directory-11/file'; +@import './directory-11/file'; +@import '../scss/directory-11/file'; diff --git a/test/scss/nested/_example-5.scss b/test/scss/nested/_example-5.scss new file mode 100644 index 00000000..8775f80f --- /dev/null +++ b/test/scss/nested/_example-5.scss @@ -0,0 +1,3 @@ +.example-5 { + color: aquamarine; +} diff --git a/test/scss/nested/example-4.scss b/test/scss/nested/example-4.scss new file mode 100644 index 00000000..956bb30d --- /dev/null +++ b/test/scss/nested/example-4.scss @@ -0,0 +1,3 @@ +.example-4 { + color: greenyellow; +} diff --git a/test/scss/nested/example-6.SCSS b/test/scss/nested/example-6.SCSS new file mode 100644 index 00000000..5f08cafc --- /dev/null +++ b/test/scss/nested/example-6.SCSS @@ -0,0 +1,3 @@ +.example-6 { + color: rosybrown; +} diff --git a/test/scss/spec/.gitignore b/test/scss/spec/.gitignore deleted file mode 100644 index db8b4be7..00000000 --- a/test/scss/spec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Will be populated by npm pretest -*.css diff --git a/test/scss/spec/dart-sass/.gitignore b/test/scss/spec/dart-sass/.gitignore deleted file mode 100644 index db8b4be7..00000000 --- a/test/scss/spec/dart-sass/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Will be populated by npm pretest -*.css diff --git a/test/scss/spec/node-sass/.gitignore b/test/scss/spec/node-sass/.gitignore deleted file mode 100644 index db8b4be7..00000000 --- a/test/scss/spec/node-sass/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Will be populated by npm pretest -*.css diff --git a/test/scss/word-10/_index.css b/test/scss/word-10/_index.css new file mode 100644 index 00000000..142062d9 --- /dev/null +++ b/test/scss/word-10/_index.css @@ -0,0 +1,3 @@ +.word-10 { + color: #fff4c2; +} diff --git a/test/scss/word-11/index.css b/test/scss/word-11/index.css new file mode 100644 index 00000000..a7d5ad57 --- /dev/null +++ b/test/scss/word-11/index.css @@ -0,0 +1,3 @@ +.word-11 { + color: #008800; +} diff --git a/test/scss/word-3.scss b/test/scss/word-3.scss new file mode 100644 index 00000000..837f7eae --- /dev/null +++ b/test/scss/word-3.scss @@ -0,0 +1,3 @@ +.word-3 { + color: #000088; +} diff --git a/test/scss/word-4.sass b/test/scss/word-4.sass new file mode 100644 index 00000000..500f8051 --- /dev/null +++ b/test/scss/word-4.sass @@ -0,0 +1,2 @@ +.word-4 + color: #aaaaaa diff --git a/test/scss/word-5.css b/test/scss/word-5.css new file mode 100644 index 00000000..edc3fae0 --- /dev/null +++ b/test/scss/word-5.css @@ -0,0 +1,3 @@ +.word-5 { + color: fuchsia; +} diff --git a/test/scss/word-6/_index.scss b/test/scss/word-6/_index.scss new file mode 100644 index 00000000..5421c31e --- /dev/null +++ b/test/scss/word-6/_index.scss @@ -0,0 +1,3 @@ +.word-6 { + color: azure; +} diff --git a/test/scss/word-7/index.scss b/test/scss/word-7/index.scss new file mode 100644 index 00000000..b74b592b --- /dev/null +++ b/test/scss/word-7/index.scss @@ -0,0 +1,3 @@ +.word-7 { + color: red; +} diff --git a/test/scss/word-8/_index.sass b/test/scss/word-8/_index.sass new file mode 100644 index 00000000..95cfd5e1 --- /dev/null +++ b/test/scss/word-8/_index.sass @@ -0,0 +1,2 @@ +.word-8 + color: moccasin diff --git a/test/scss/word-9/index.sass b/test/scss/word-9/index.sass new file mode 100644 index 00000000..9233dd61 --- /dev/null +++ b/test/scss/word-9/index.sass @@ -0,0 +1,2 @@ +.word-9 + color: darkcyan