how to change vue-cli-service build lib image address in css to absolute path #7103
Unanswered
arishojaei
asked this question in
Q&A
Replies: 2 comments
-
Can you provide a mini repo for reproduction? |
Beta Was this translation helpful? Give feedback.
0 replies
-
If You can try this code and change it in your way 👇 module.exports = {
chainWebpack(config => {
config.module
.rule('svg')
.use('file-loader')
.tap(opts => ({
...opts,
publicPath: process.cwd(),
}))
})
} If module.exports = {
chainWebpack(config => {
config.module
.rule('svg')
.set('generator', {
publicPath: process.cwd()
})
})
} Then, build your component library |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'll make my question short!
I write this in my
*.scss
file:after I run
yarn build
I get this in my*.css
:BUT, I don't want first
/
in url:I use
vue-cli-serice
to build a component library and when I use this library in a Nuxtjs project, my images didn't load because images address are relative and didn't read from/dist/img/
in my package in my node_modulesBeta Was this translation helpful? Give feedback.
All reactions