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

Add to option to rollup-plugin-postcss #1002

Open
mgburns opened this issue Sep 25, 2022 · 0 comments
Open

Add to option to rollup-plugin-postcss #1002

mgburns opened this issue Sep 25, 2022 · 0 comments
Labels

Comments

@mgburns
Copy link

mgburns commented Sep 25, 2022

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!

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

No branches or pull requests

2 participants