thgh / rollup-plugin-scss

Rollup and compile multiple .scss, .sass and .css imports
MIT License
134 stars 47 forks source link

How to use postcss-url plugin? #53

Open xingyibiao opened 3 years ago

xingyibiao commented 3 years ago

I want to use postcss-url plugin. but not work for me. It`s my config,

scss({
      processor: css => postcss([px2rem({ remUnit: 75, remPrecision: 5 }), url({ url: 'copy', assetsPath: './assets' })]),
      output: 'dist/bundle.css',
    }),
xingyibiao commented 3 years ago

It seams like this plugin always set postcss from is undefinded. and I want to write a postcss plugin to copy file, but not work

thgh commented 3 years ago

Have you tried to set from? What could this plugin do better?

    scss({
      processor: css => postcss([px2rem({ remUnit: 75, remPrecision: 5 }), url({ url: 'copy', assetsPath: './assets' })]),
      output: 'dist/bundle.css',
      from: "somefile"
    }),