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

Css is not minimized #283

Closed
Mioleris opened this issue Mar 8, 2017 · 6 comments
Closed

Css is not minimized #283

Mioleris opened this issue Mar 8, 2017 · 6 comments

Comments

@Mioleris
Copy link

Mioleris commented Mar 8, 2017

Why bootstrap css is not minimized when using extractStyles and bootstrapCustomizations and appStyles

and when using appStyles and bootstrapCustomizations adds 3-4s to hot module replacement to reload

            {
                test: /\.scss$/,
                use: ExtractTextPlugin.extract({
                    fallback: "style-loader",
                    use: ['css-loader?minimize&importLoaders=2', 'postcss-loader', 'sass-loader']
                })
            },
            {
                test: /\.css$/,
                use: ExtractTextPlugin.extract({
                    fallback: "style-loader",
                    use: ['css-loader?minimize&importLoaders=1', 'postcss-loader']
                })
            }

Using latest dependencies

@Mioleris
Copy link
Author

Mioleris commented Mar 8, 2017

  1. Problem is solved adding in .bootstraprc
# Webpack loaders, order matters
styleLoaders:
  - style-loader
  - css-loader?minimize&importLoaders=2
  - postcss-loader
  - sass-loader
  1. Problem with hot module replacement exists.
    When using appStyles and bootstrapCustomizations to import custom scss files it slows down HMR about 3-4s. If I'm not using them it reloads in about 800ms

I'm importing custom style from node_modules like this appStyles: ~myApp/lib/common.scss
~ gives such a long reload

@justin808
Copy link
Member

@Mioleris Maybe if you don't minimize for development?

@alexfedoseev @Judahmeek This might be a good reason to get this merged: #126 and then the minimize can be configured the Node.env?

@robwise with the move to Webpacker for React on Rails, we'll need to minimize the CSS using Webpack.

@justin808
Copy link
Member

@Mioleris Any chance that you can create a doc PR for this one?

@justin808
Copy link
Member

@Mioleris I'll reopen this one if you recommend we do so.

@chadsaun
Copy link

Is there a way to make minimize dynamic based on environment?

@alex35mil
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants