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

webpack2 , upgrade extract-text-webpack-plugin error #37

Open
zhangfu-git opened this issue Feb 13, 2017 · 6 comments
Open

webpack2 , upgrade extract-text-webpack-plugin error #37

zhangfu-git opened this issue Feb 13, 2017 · 6 comments

Comments

@zhangfu-git
Copy link

my code:
var styleLoader = require('extract-text-webpack-plugin').extract(['css-loader', 'postcss-loader', 'less-loader']);
module.exports = {
styleLoader: styleLoader,
scripts: {
"alert" : true,
"button" : true,
"carousel" : true,
"dropdown" : true,
"modal" : true,
"tooltip" : true,
"popover" : true,
"tab" : true,
"affix" : true,
"collapse" : true,
"scrollspy" : true
},
styles: {
"mixins" : true,
"utilities": true,
"type" : true,
"normalize": true,
"forms" : true,
"grid": true,
"buttons" : true,
"responsive-utilities" : true,
"print" : true,
"code" : true,
"responsive-embed" : true,
"glyphicons" : true,
"images": true,
"modal" : true,
"print" : true,
"type" : true,
"code" : true,
"grid" : true,
"tables" : true,
"forms" : true,
"buttons" : true,
"responsive-utilities" : true,
"button-groups" : true,
"input-groups" : true,
"component-animations" : true,
"dropdowns" : true,
"tooltip" : true,
"popovers" : true,
"modals" : true,
"carousel" : true
}
};
ERROR in ./~/bootstrap-webpack/index.loader.js!./assets/app/common/bootstrap.config.js
Module not found: Error: Can't resolve '[object Object],[object Object],[object Object],[object Object]' in '/home/zhangfu/bitinvo_webpack/assets/app/common'

@mw-ding
Copy link

mw-ding commented Feb 26, 2017

Having the same issue here after upgrade to webpack 2.0. Is anybody looking into this issue? :)

@bring2dip
Copy link

Same here

@rudolfschmidt
Copy link

rudolfschmidt commented Mar 9, 2017

same. If I dont use @import it works, but If I import another css file that is loaded via a css file that is loaded via extract plugin it doesnt find the loader that is necessary to load the suffix like ttf for base64 encoding

@vlmonk
Copy link

vlmonk commented Mar 14, 2017

I find dirty workaround for this issue. put in bootstrap.config.js

var loader = require('extract-text-webpack-plugin').extract({ fallback: 'style-loader', use: 'css-loader?sourceMap!less-loader?sourceMap'})
var styleLoader = loader.map( chunk => {
  const path = chunk.loader

  if (chunk.options) {
    const options = JSON.stringify(chunk.options)
    return `${path}?${options}`
  }

  return path
}).join('!')

module.exports = {
  styleLoader: styleLoader,
    scripts: {
    'transition': true,
    'alert': true,
....

@zhnoah
Copy link

zhnoah commented Apr 28, 2017

Same here.

node: v7.9.0
npm: 4.2.0
webpack: ^2.4.1
extract-text-webpack-plugin: ^2.1.0

Is anybody looking into this issue?
Thanks.

@omnichronous
Copy link

@vlmonk a thousand thanks. This is the only solution that worked for me. I just had to require and use the plugin in my webpack.config.js also.

This is my environment:

node: v6.10.2
npm: 5.0.3

"bootstrap-webpack": "0.0.6",
"extract-text-webpack-plugin": "^2.1.2",
"webpack": "^2.6.1",

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