RequireJS requires less and requires-css pathing

I use the require-less require-less plugin along with the require-css plugin.

My paths become messy when using LESS files, but NOT when using CSS files.

My paths look like this:

'css!assets/fontello/fontello-codes', 'less!assets/bootstrap/bootstrap', 

My url is:

 http://localhost/phoenix 

when LESS files are requested, they end:

 'http://localhost/phoenix/phoenix/assets/bootstrap/bootstrap.less' 

I set my base URL:

  baseUrl: "./phoenix/" 

If I do less!../assets/bootstrap/bootstrap , this works, but not if the paths change, of course.

What am I missing here?

+6
source share
1 answer

baseUrl: "./phoenix/" works with the location where the require.js configuration file, say init.js, is located, so if it is in localhost/phoenix and you believe the baseUrl location is working properly, you can either delete baseUrl or level in your folder structure that init.js.

0
source

Source: https://habr.com/ru/post/957942/


All Articles