bootstrap-webpack icon indicating copy to clipboard operation
bootstrap-webpack copied to clipboard

webpack2 , upgrade extract-text-webpack-plugin error

Open zhangfu-git opened this issue 8 years ago • 6 comments

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'

zhangfu-git avatar Feb 13 '17 04:02 zhangfu-git

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

mw-ding avatar Feb 26 '17 23:02 mw-ding

Same here

bring2dip avatar Mar 04 '17 08:03 bring2dip

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

rudolfschmidt avatar Mar 09 '17 11:03 rudolfschmidt

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,
....

vlmonk avatar Mar 14 '17 18:03 vlmonk

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.

zhnoah avatar Apr 28 '17 02:04 zhnoah

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

omnichronous avatar Jun 22 '17 14:06 omnichronous