gowravshekar / bootstrap-webpack

bootstrap package for webpack
MIT License
135 stars 22 forks source link

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

Open zhangfu-git opened 7 years ago

zhangfu-git commented 7 years ago

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 commented 7 years ago

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

bring2dip commented 7 years ago

Same here

rudolfschmidt commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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",