Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

trim style to eliminate new lines as result of padContent #144

Closed
yakovyarmo opened this issue Oct 17, 2017 · 4 comments
Closed

trim style to eliminate new lines as result of padContent #144

yakovyarmo opened this issue Oct 17, 2017 · 4 comments

Comments

@yakovyarmo
Copy link

@znck
Copy link
Member

znck commented Oct 17, 2017

padContent is used to simplify source map generation. You can use any css processor to minify in production build.

@znck znck closed this as completed Oct 17, 2017
@yakovyarmo
Copy link
Author

yakovyarmo commented Oct 17, 2017

but the problem is that you send the concatenation of that to the css function like in example:

// rollup.config.js
import fs from 'fs'
import vue from 'rollup-plugin-vue'

export default {
  ...
  plugins: [
      vue({
          css (style, styles, compiler) {
              fs.writeFileSync('dist/bundle.css', style)
              fs.writeFileSync('dist/bundle.sass', styles.map(style => style.code).concat('\n'))
          }
      })
  ],
  ...
}

and the style argument is padded with way too many spaces

@znck znck reopened this Oct 17, 2017
@znck
Copy link
Member

znck commented Oct 17, 2017

Okay. I'll keep it open and revisit after vuejs/vue-component-compiler#29 is merged.

@znck
Copy link
Member

znck commented May 2, 2018

@vue/component-compiler uses clean css to minimize each style tag separately.

@znck znck closed this as completed May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants