Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when importing module the webpack way #27

Closed
craigcosmo opened this issue Dec 27, 2016 · 3 comments
Closed

error when importing module the webpack way #27

craigcosmo opened this issue Dec 27, 2016 · 3 comments
Labels

Comments

@craigcosmo
Copy link

craigcosmo commented Dec 27, 2016

import `css!sass!./style.css`

Will give you error. This plugin is trying to resolve that module name as css!sass!./style.css instead of style.css

@craigcosmo
Copy link
Author

is there anyone having this issue as well?

@gajus gajus added the question label Jan 6, 2017
@gajus
Copy link
Owner

gajus commented Jan 6, 2017

This is webpack specific loader syntax. It is not supported at the moment.

There are no plans to add support for it – this syntax has been deprecated and will be removed in future webpack versions. (I cannot find where this is documented at the moment. Maybe I am wrong.)

Regardless, webpack documentation advises against using this syntax:

Note: Avoid using this, if at all possible, if you intend your scripts to be environment agnostic (node.js and browser). Use the configuration convention for specifying loaders (see next section).

https://webpack.github.io/docs/using-loaders.html#loaders-in-require

@gajus gajus closed this as completed Jan 6, 2017
@RISCfuture
Copy link

There is a valid use case for this scenario though. In some cases you may want to one-off load CSS a different way, using different loaders. For example, in my project, I have one case where I want to load the CSS using css-object-loader instead of my normal CSS loader pipeline, because I use the CSS differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants