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

Issues with requiring CSS from plugin #8

Closed
plwalters opened this issue Apr 20, 2016 · 7 comments
Closed

Issues with requiring CSS from plugin #8

plwalters opened this issue Apr 20, 2016 · 7 comments

Comments

@plwalters
Copy link

More details here -

aurelia/dialog#127

But I believe if a plugin requires css from html file it fails.

@plwalters
Copy link
Author

Also this seems related - aurelia/dialog#135

@Thanood
Copy link

Thanood commented Apr 20, 2016

Maybe related: aurelia/webpack-plugin#11

@valichek
Copy link

Here is the solution how to avoid errors when using <require from="dialog.css">. Just two line in webpack config needed.

{ test: /aurelia-dialog\/dist\/commonjs\/dialog\.css/, loader: 'raw'},
{ test: /\.css?$/, exclude: /aurelia-dialog\/dist\/commonjs\/dialog\.css/, loader: 'style!css' },

First we load it with raw-loader and exclude it from loading with css-loader, and you go

@Vheissu
Copy link
Member

Vheissu commented Jul 4, 2016

I believe this issue is fixed in the latest Webpack implementation stuff @PWKad ?

@kdekooter
Copy link

Sorry folks but it looks like it has not been fixed yet:

WARNING in ./src ^\.\/.*$
Module not found: Error: Can't resolve 'css' in '/Users/.../src'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' prefix when using loaders.
                 You need to specify 'css-loader' instead of 'css'.
 @ ./src ^\.\/.*$
 @ ./~/aurelia-loader-webpack/dist/commonjs/aurelia-loader-webpack.js
 @ multi aurelia

@niieani
Copy link
Contributor

niieani commented Nov 25, 2016

@kdekooter was fixed in aurelia/webpack-plugin@472558f which isn't yet released. This is a new problem, caused by breaking changes in latest betas of Webpack v2.

You can workaround this problem either by updating @easy-webpack/config-aurelia (if you use it), or simply by passing the customViewLoaders option to the WebpackPlugin with the value:

    customViewLoaders: {
      '.css': ['css-loader'],
      '.scss': ['css-loader', 'sass-loader'],
      '.sass': ['css-loader', 'sass-loader'],
      '.less': ['css-loader', 'less-loader'],
      '.styl': ['css-loader', 'stylus-loader'],
    }

@kdekooter
Copy link

Thanks for the swift response @niieani. That saved my day!

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

No branches or pull requests

7 participants