shakacode / bootstrap-loader

Load Bootstrap styles and scripts in your Webpack bundle
MIT License
1.02k stars 487 forks source link

Regression in glyphicons handling for 1.1.1 #143

Closed muuki88 closed 8 years ago

muuki88 commented 8 years ago

Hi,

We just upgraded to the brand new 1.1.1 from 1.1.0 and found a regression regarding the glyphicons handling. It seems that despite we disable glyphicons, bootstrap-loader tries to process them.

When running our webpack production build we get the following error

ModuleParseError: Module parse failed: /var/lib/jenkins/workspace/our-project/our-project-build-build/node_modules/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.eot Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '�' (1:0)

Configuration

This is our webpack loader configuration

    loaders: [
      {
        test: /.jsx?$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
        query: {
          presets: ['es2015', 'react', 'stage-1']
        }
      },
      {test: /\.svg$/,  loader: 'svg-inline'},
      {test: /bootstrap-sass\/assets\/javascripts\//,  loader: 'imports?jQuery=jquery'},
      {test: /\.[s]?css$/, loader: ExtractTextPlugin.extract('style', 'css!sass?outputStyle=expanded')},
      {test: /modernizr-config.json$/, loader: 'modernizr'}
    ]

Our .bootstraprc looks like this


---
# src: https://github.com/shakacode/bootstrap-loader/blob/master/.bootstraprc-3-default
#
# see: https://github.com/shakacode/bootstrap-loader
# see: https://github.com/shakacode/sass-resources-loader
#
# Output debugging info
# loglevel: debug

# Major version of Bootstrap: 3 or 4
bootstrapVersion: 3

# Webpack loaders, order matters
styleLoaders:
  - style
  - css?sourceMap
  - sass?sourceMap

# Extract styles to stand-alone css file
# Different settings for different environments can be used,
# It depends on value of NODE_ENV environment variable
# This param can also be set in webpack config:
#   entry: 'bootstrap-loader/extractStyles'
extractStyles: true
# env:
#   development:
#     extractStyles: false
#   production:
#     extractStyles: true

# Customize Bootstrap variables that get imported before the original Bootstrap variables.
# Thus, derived Bootstrap variables can depend on values from here.
# See the Bootstrap _variables.scss file for examples of derived Bootstrap variables.
#
preBootstrapCustomizations: ./app/main/styles/bootstrap/variables.scss

# This gets loaded after bootstrap/variables is loaded
# Thus, you may customize Bootstrap variables
# based on the values established in the Bootstrap _variables.scss file
#
#bootstrapCustomizations: ./app/main/pa/styles/base/_bootswatch_paper.scss

# Import your custom styles here
# Usually this endpoint-file contains list of @imports of your application styles
#
appStyles: ./app/main/main.scss

### Bootstrap styles
styles:

  # Mixins
  mixins: true

  # Reset and dependencies
  normalize: true
  print: true
  glyphicons: false

  # Core CSS
  scaffolding: true
  type: true
  code: true
  grid: true
  tables: true
  forms: true
  buttons: true

  # Components
  component-animations: true
  dropdowns: true
  button-groups: true
  input-groups: true
  navs: true
  navbar: true
  breadcrumbs: true
  pagination: true
  pager: true
  labels: true
  badges: true
  jumbotron: true
  thumbnails: true
  alerts: true
  progress-bars: true
  media: true
  list-group: true
  panels: true
  wells: false
  responsive-embed: true
  close: true

  # Components w/ JavaScript
  modals: true
  tooltip: false
  popovers: false
  carousel: false

  # Utility classes
  utilities: true
  responsive-utilities: true

### Bootstrap scripts
scripts:
  transition: true
  alert: true
  button: true
  carousel: false
  collapse: true
  dropdown: true
  modal: false
  tooltip: false
  popover: false
  scrollspy: false
  tab: true
  affix: false
AlexKVal commented 8 years ago

Probably related to the regression https://github.com/shakacode/bootstrap-loader/pull/147

justin808 commented 8 years ago

@muuki88 Please verify that 1.1.2 fixes the issue.

muuki88 commented 8 years ago

works with 1.1.3

muuki88 commented 8 years ago

Thanks for the quick fix :)