stealjs / steal-css

StealJS plugin for CSS
https://www.npmjs.com/package/steal-css
MIT License
2 stars 1 forks source link

Relative url()s do not work in Node #35

Closed phillipskevin closed 7 years ago

phillipskevin commented 7 years ago

See https://github.com/donejs/css/issues/59.

phillipskevin commented 7 years ago

This is not working in production mode.

phillipskevin commented 7 years ago

@nlundquist confirmed this is happening because of bundleAssets: false:

~/dev/ting-node [donejs1.0|✚3…30⚑9]
16:51 $ cat dist/bundles/ting-node/page/internet/index/index.css | grep bannerNarrowCharlottesville
  background-image: url(../../../../../src/assets/images/bannerNarrowCharlottesville.svg);
~/dev/ting-node [donejs1.0|✚3…30⚑9]
16:51 $ node
> path.join('/Users/kevin/dev/ting-node/dist/bundles/ting-node/page/internet/index/', '../../../../../src/assets/images/bannerNarrowCharlottesville.svg')
'/Users/kevin/dev/ting-node/dist/src/assets/images/bannerNarrowCharlottesville.svg'

With bundleAssets: true the path is updated correctly:

~/dev/ting-node [donejs1.0|✚3…30⚑9]
16:51 $ cat dist/bundles/ting-node/page/internet/index/index.css | grep bannerNarrowCharlottesville
  background-image: url(../../../../../src/assets/images/bannerNarrowCharlottesville.svg);
~/dev/ting-node [donejs1.0|✚3…30⚑9]
16:51 $ node
> path.join('/Users/kevin/dev/ting-node/dist/bundles/ting-node/page/internet/index/', '../../../../../src/assets/images/bannerNarrowCharlottesville.svg')
'/Users/kevin/dev/ting-node/dist/src/assets/images/bannerNarrowCharlottesville.svg'