{"_id":"less-import-aliases","_rev":"6-c407c5da590b4fd2383d75530cdf7eaa","name":"less-import-aliases","description":"LESS plugin to use aliases in @importing files.","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"less-import-aliases","version":"1.0.0","description":"LESS plugin to use aliases in @importing files.","main":"index.js","dependencies":{"readable-stream":"2.0.1","replacestream":"4.0.0","resolve":"1.1.6","promise":"7.0.4"},"repository":{"type":"git","url":"git+https://github.com/miloszsobczak/less-import-aliases.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["gulpplugin","alias","less alias","import","paths"],"author":{"name":"Miłosz Sobczak","email":"miloszsobczak@pixers.pl"},"license":"BSD","gitHead":"4ecc1c378afd0d1f56ffb5452b4d97f33fb290a7","bugs":{"url":"https://github.com/miloszsobczak/less-import-aliases/issues"},"homepage":"https://github.com/miloszsobczak/less-import-aliases#readme","_id":"less-import-aliases@1.0.0","_shasum":"ce151f1551ebe0f90d6604f918e1a1688b574c12","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"miloszsobczak","email":"kontakt@miloszsobczak.pl"},"dist":{"shasum":"ce151f1551ebe0f90d6604f918e1a1688b574c12","tarball":"https://registry.npmjs.org/less-import-aliases/-/less-import-aliases-1.0.0.tgz","integrity":"sha512-HTJb5nYeC1RGTNmDH24kwX0Swb/Pvo70AYE+8PAzNI9xA5gV5kasT2zWDIY+Js8uwgQCo2ndiGkplJuC+5gmhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDz6EcK00NeAGjZxw2UptepBvxu6RpHcaLwIErmpUTRTAIgXWfnZ595LhJfrxYge0K7R0yaB0+VmjBUVDGyIyCouik="}]},"maintainers":[{"name":"miloszsobczak","email":"kontakt@miloszsobczak.pl"}]},"1.0.1":{"name":"less-import-aliases","version":"1.0.1","description":"LESS plugin to use aliases in @importing files.","main":"index.js","dependencies":{"readable-stream":"2.0.1","replacestream":"4.0.0","resolve":"1.1.6","promise":"7.0.4"},"repository":{"type":"git","url":"git+https://github.com/miloszsobczak/less-import-aliases.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["gulpplugin","gulp plugin","gulp","less","less plugin","less alias","import alias","import aliases","alias","import","paths"],"author":{"name":"Miłosz Sobczak","email":"miloszsobczak@pixers.pl"},"license":"BSD","gitHead":"7224c3c8b70095769e718d8cb756e8f5b609f878","bugs":{"url":"https://github.com/miloszsobczak/less-import-aliases/issues"},"homepage":"https://github.com/miloszsobczak/less-import-aliases#readme","_id":"less-import-aliases@1.0.1","_shasum":"bb75d0feb9cd627640b10a94a134ec20ec21d1c9","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"miloszsobczak","email":"kontakt@miloszsobczak.pl"},"dist":{"shasum":"bb75d0feb9cd627640b10a94a134ec20ec21d1c9","tarball":"https://registry.npmjs.org/less-import-aliases/-/less-import-aliases-1.0.1.tgz","integrity":"sha512-6C3wTud3I2ZdMVnJ18v+mgrNUJ5vK/q7zvrCNUPuUwveCWcklFkS+8MK8PxP38e6E6LOmvyHMKhllw3SHUQmjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG0oj/PBC/9WlRFhbQAou1pjlVWflh7F3p1Xw2spZmSsAiAiYigUuUPTXzg5SFhEVilfSmJZKUj5Un/TWWdHG7TwKg=="}]},"maintainers":[{"name":"miloszsobczak","email":"kontakt@miloszsobczak.pl"}]},"1.0.2":{"name":"less-import-aliases","version":"1.0.2","description":"LESS plugin to use aliases in @importing files.","main":"index.js","dependencies":{"readable-stream":"2.0.1","replacestream":"4.0.0","resolve":"1.1.6","promise":"7.0.4"},"repository":{"type":"git","url":"git+https://github.com/pixers/less-import-aliases.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["gulpplugin","gulp plugin","gulp","less","less plugin","less alias","import alias","import aliases","alias","import","paths"],"author":{"name":"Miłosz Sobczak","email":"miloszsobczak@pixers.pl"},"license":"BSD","gitHead":"5dc035f50af62eaf746ffb89e699d160fc852a2f","bugs":{"url":"https://github.com/pixers/less-import-aliases/issues"},"homepage":"https://github.com/pixers/less-import-aliases#readme","_id":"less-import-aliases@1.0.2","_shasum":"f560a76e0b97ed0f2ff35233da685f2b40990474","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"miloszsobczak","email":"kontakt@miloszsobczak.pl"},"dist":{"shasum":"f560a76e0b97ed0f2ff35233da685f2b40990474","tarball":"https://registry.npmjs.org/less-import-aliases/-/less-import-aliases-1.0.2.tgz","integrity":"sha512-PMTe7tz+bAD5xcfdAtc+xupXcSbLQOezfBP33X99OAh56MkleARsmw3Z4SFo9U3o4YpMJAI+VPahAav0XG6mPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGe0C3nM/qVMKrzZ55OuuFKz3dJWyn2pEw9iOt/FSVRKAiEAsi3hpH0SeX57yk30BqLd41hLg6FbOZwaEbUrYwXo/Hs="}]},"maintainers":[{"email":"kontakt@miloszsobczak.pl","name":"miloszsobczak"},{"email":"sylwester.luczak@gmail.com","name":"ikselll"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/less-import-aliases-1.0.2.tgz_1511774907959_0.8090932241175324"}}},"readme":"less-import-aliases\n========================\n> Rewrite imports paths with defined alises\n\nFirst of all, big thanks for [less-plugin-npm-import](https://www.npmjs.com/package/less-plugin-npm-import), which this package relies on (paths replacement part).\n\nDuring complex development, finally you will be having issues with LESS files organization.\nThis plugin will help you have nice syntax of your paths (even relative to each other) thanks to **aliases**.\n\n## Usage\n\n### Instalation\n```shell\nnpm install --save-dev less-import-aliases\n```\n#### Example files structure\nLet's assume you have complicated files structure like this:\n```\n.\n├── gulpfile.js\n├── public\n│   └── styles\n│       ├── dest\n│       └── src\n│           ├── first_loader.less\n│           └── second_loader.less\n└── src\n    └── bundles\n        ├── FrontBundle\n        │   └── styles\n        │       └── less\n        │           └── modules\n        │               ├── module1\n        │               │   ├── first_file.less\n        │               │   └── second_file.less\n        │               └── module2\n        │                   ├── first_file.less\n        │                   └── second_file.less\n        └── OrderBundle\n            └── styles\n                └── less\n                    └── modules\n                        ├── module1\n                        │   ├── first_file.less\n                        │   └── second_file.less\n                        └── module2\n                            ├── first_file.less\n                            └── second_file.less\n```\n#### PROBLEM\nIn this case you would be forced to create really awfull paths with some kind of relativity. It's always problematic.\n\n*Instead of using:*\n```less\n//first_loader.less\n@import \"../../../src/bundles/FrontBundle/styles/less/modules/module1/first_file.less\"\n@import \"../../../src/bundles/OrderBundle/styles/less/modules/module1/first_file.less\"\n```\n```less\n//FrontBundle -> first_file.less\n@import \"../../../../../OrderBundle/styles/less/modules/module1/first_file.less\"\n```\n\n*thanks to this plugin, you can just use:*\n```less\n//first_loader.less\n@import \"@FrontBundle/modules/module1/first_file.less\"\n@import \"@OrderBundle/modules/module1/first_file.less\"\n```\n```less\n//FrontBundle -> first_file.less\n@import \"@OrderBundle/modules/module1/first_file.less\"\n```\n\n### BE CAREFUL\nIf you want to use aliases, you have to type prefix - `@` inside your LESS file;\nNot having this kind of notation could couse naming conflicts.\nYou want to avoid it.\n\n### LESS PLUGIN (ex. gulpfile.js)\n```javascript\nvar getAliasFileManager = require('less-import-aliases');\n    less = require('gulp-less');\nvar frontPath = __dirname + '/public/src/front_bundle/styles/less',\n    orderPath = __dirname + '/public/src/order_bundle/styles/less';\n\ngulp.task('compileLESS', function(){\n  gulp.src(['public/styles/src/*.less'])\n    .pipe(less({\n        plugins: [new getAliasFileManager({\n            aliases: {\n                FrontBundle: frontPath,\n                OrderBundle: orderPath\n            }\n        })]\n    }))\n    .pipe(gulp.dest('public/styles/dist'));\n});\n```\n\n## API\n\nless-import-aliases ought to be called with `Object` as:\n```javascript\n{\n    alias: path_to_this_alias,\n    alias_second: path_to_this_alias_second\n}\n```\n**The key has to be used without \"at[@]\" prefix**\n\n[MDN documentation for RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n[MDN documentation for String.replace]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter","maintainers":[{"email":"kontakt@miloszsobczak.pl","name":"miloszsobczak"},{"email":"sylwester.luczak@gmail.com","name":"ikselll"}],"time":{"modified":"2022-06-19T11:39:37.198Z","created":"2015-08-21T13:45:27.269Z","1.0.0":"2015-08-21T13:45:27.269Z","1.0.1":"2015-08-24T07:47:44.901Z","1.0.2":"2017-11-27T09:28:28.024Z"},"homepage":"https://github.com/pixers/less-import-aliases#readme","keywords":["gulpplugin","gulp plugin","gulp","less","less plugin","less alias","import alias","import aliases","alias","import","paths"],"repository":{"type":"git","url":"git+https://github.com/pixers/less-import-aliases.git"},"author":{"name":"Miłosz Sobczak","email":"miloszsobczak@pixers.pl"},"bugs":{"url":"https://github.com/pixers/less-import-aliases/issues"},"license":"BSD","readmeFilename":"README.md"}