shakacode / font-awesome-loader

Webpack Loader for Font Awesome Using Sass
MIT License
46 stars 19 forks source link

Not compatible with ExtractTextWebpack 2.0.0 #9

Closed diondirza closed 7 years ago

diondirza commented 7 years ago

Been using this config with extract-text-webpack-plugin

module.exports = {
  styleLoader: require('extract-text-webpack-plugin').extract({
    fallback: 'style-loader',
    use: ['css-loader', 'sass-loader'],
  }),
  styles: {
    'mixins': true,
    ...
  },
};

was working fine before, until the update then it produces an error with following message:

ERROR in ./~/font-awesome-loader/index.loader.js!./internal/webpack/font-awesome.config.js
Module not found: Error: Can't resolve '[object Object],[object Object],[object Object]' in '/Users/diondirza/Projects/Site/midtrans/lemonade/internal
/webpack'
 @ ./~/font-awesome-loader/index.loader.js!./internal/webpack/font-awesome.config.js 1:0-261
 @ multi regenerator-runtime/runtime bootstrap-loader/extractStyles font-awesome-loader!./internal/webpack/font-awesome.config.js ./src/client/index.j
s

Any clue to fix this?

justin808 commented 7 years ago

Hi @diondirza. This would require a bit of updating to support webpack v2 and the new loader. The code should be similar to what's done here: https://github.com/shakacode/bootstrap-loader

If you can, please submit a PR.

justin808 commented 7 years ago

@judahmeek we'll probably want this for up upcoming work.

diondirza commented 7 years ago

@justin808 it works using configuration that mentioned here

justin808 commented 7 years ago

@diondirza Any comments on PR #8? I'm about to merge that in!

diondirza commented 7 years ago

@justin808 maybe we should add some points for the sake of clarity, like readme for v1 and v2; ~~v2 setup need to add import 'font-awesome/scss/font-awesome.scss'; in entry file v2 setup also doesn't need to add font-awesome.config.scss like previous one if file is not exist will throw error~~

justin808 commented 7 years ago

That would be awesome. Please submit a PR!

diondirza commented 7 years ago

@justin808 PR submitted please take a look