webpack-contrib / stylus-loader

:art: A stylus loader for webpack.
MIT License
498 stars 99 forks source link

expected "indent", got "keyframes" when importing css and using webpackImporter #297

Closed alan-agius4 closed 3 years ago

alan-agius4 commented 3 years ago

Expected Behavior

At the moment in version 4 when using the webpackImporter option it seems to be impossible to import a .css file in a .styl file, as this will result in an error because of the .css file contents will be a JavaScript module. Previously in version 3 this used to work.

Example

@import "~bootstrap-stylus/lib/bootstrap";
@import "@angular/material/prebuilt-themes/indigo-pink.css";

Will result in the below error.

Actual Behavior

ERROR in ./styles.styl (./node_modules/css-loader/dist/cjs.js!./node_modules/stylus-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./styles.styl)
Module Error (from ./node_modules/stylus-loader/dist/cjs.js):
expected "indent", got "keyframes"
 @ ./styles.styl 2:12-157 9:17-24 13:15-29
 @ ./index.js 1:0-22

How Do We Reproduce?

git clone https://github.com/alan-agius4/stylus-loader-importer.git
cd stylus-loader-importer
yarn
yarn webpack