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

anyway to external styleInject function to prevent the duplicate? #367

Open
lili21 opened this issue Apr 22, 2021 · 3 comments · May be fixed by #375
Open

anyway to external styleInject function to prevent the duplicate? #367

lili21 opened this issue Apr 22, 2021 · 3 comments · May be fixed by #375

Comments

@lili21
Copy link

lili21 commented Apr 22, 2021

No description provided.

@Flcwl
Copy link

Flcwl commented May 13, 2021

@lili21 I have the same issue. The style-inject package using wrong relative path! As shown below~

image

I hope it can become like this. or anyway to external it, please~

var styleInject = require('style-inject/dist/style-inject.es.js');

@Flcwl
Copy link

Flcwl commented May 13, 2021

It also not work~
image

@Flcwl Flcwl linked a pull request May 17, 2021 that will close this issue
@willyelm
Copy link

Probably a bit late but I dealt with the same issues while trying to build a precompiled library excluding the css injection part. it is possible to override the code output by setting up a inject parameter function:

postcss({
  ...,
  inject(cssVariableName) {
    return `import styleInject from 'style-inject';\nstyleInject(${cssVariableName});`;
  }
})

hope it helps to anyone trying to find a workaround.

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

Successfully merging a pull request may close this issue.

3 participants