Skip to content

Add to option to rollup-plugin-postcss #1002

@mgburns

Description

@mgburns

I'm trying to use the postcss-url plugin to copy fonts that are imported by my CSS into the build directory. In order for it to work properly it requires the to option for rollup-plugin-postcss to be set.

I was able to get it working locally by setting to: absMain.replace(EXTENSION, '.css') here:

microbundle/src/index.js

Lines 495 to 498 in 22187fb

extract:
!!writeMeta &&
options.css !== 'inline' &&
absMain.replace(EXTENSION, '.css'),

This is the postcss.config.js I'm trying to use:

module.exports = {
  plugins: {
    'postcss-url': {
      url: 'copy',
      basePath: '.',
      assetsPath: '',
      useHash: false,
    },
  },
};

Happy to provide more details, and thanks for your efforts on this great project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions