Webpack && stylus-loader incorrectly resolve url paths

后端 未结 1 1632
时光取名叫无心
时光取名叫无心 2020-12-31 19:45

Let\'s say I have home.styl menu/ menu.styl image.svg

home.styl is required from an entry point or JS.

Then:

ho

1条回答
  •  有刺的猬
    2020-12-31 20:50

    You want to use stylus-loader's resolve url option, which will replace the url() function inside your .styl files with a custom resolver.

    {
      test:   /\.styl$/,
      loader: 'style!css!stylus?resolve url'
    }
    

    See the corresponding code. Pretty cool solution.

    0 讨论(0)
提交回复
热议问题