Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robinck/alias-resolve-loader
Alias Resolve preLoader for webpack πΊπ¦
https://github.com/robinck/alias-resolve-loader
aliases loader preloader webpack
Last synced: 2 months ago
JSON representation
Alias Resolve preLoader for webpack πΊπ¦
- Host: GitHub
- URL: https://github.com/robinck/alias-resolve-loader
- Owner: RobinCK
- License: mit
- Created: 2016-11-17T12:57:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-17T03:53:15.000Z (about 2 years ago)
- Last Synced: 2024-10-17T20:04:53.811Z (3 months ago)
- Topics: aliases, loader, preloader, webpack
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/alias-resolve-loader
- Size: 71.3 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)[![Build Status](https://img.shields.io/travis/RobinCK/alias-resolve-loader.svg?style=flat-square)](https://travis-ci.org/RobinCK/alias-resolve-loader)[![Code Climate](https://img.shields.io/codeclimate/github/RobinCK/alias-resolve-loader.svg?style=flat-square)](https://codeclimate.com/github/RobinCK/alias-resolve-loader)[![npm](https://img.shields.io/npm/dt/alias-resolve-loader.svg?style=flat-square)](https://github.com/RobinCK/alias-resolve-loader)[![Dependencies](https://david-dm.org/robinck/alias-resolve-loader.svg?style=flat-square)](https://david-dm.org/robinck/alias-resolve-loader)[![devDependencies](https://david-dm.org/robinck/alias-resolve-loader/dev-status.svg?style=flat-square)](https://david-dm.org/robinck/alias-resolve-loader#info=devDependencies&view=table)[![NPM version](https://img.shields.io/npm/v/alias-resolve-loader.svg?style=flat-square)](https://www.npmjs.com/package/alias-resolve-loader)# Alias Resolve preLoader for webpack
## Install webpack 1.x
```
$ npm install --save-dev [email protected]
```## Install webpack 2.x
```
$ npm install --save-dev alias-resolve-loader
```## Example webpack 1.x config
```js
module.exports = {
//...
module: {
preLoaders: [
{
test: /\.(less|scss|css)$/,
loader: "alias-resolve-loader"
}
]
},
aliasesResolve: {
"@aliasName": "path/to/your/folder"
},
//...
};
```## Example webpack 2.x config
```js
module.exports = {
//...
module: {
rules: [
{
enforce: 'pre',
test: /\.(less|scss|css)$/,
use: {
loader: 'alias-resolve-loader',
options: {
alias: {
"@aliasName": "path/to/your/folder"
}
}
},
}
]
},
//...
};
```A javascript file before compilation
```less
@import "@aliasName/css/user.less";body {
background: #9e9e9e;
}
```will become:
```less
@import "path/to/your/folder/css/user.less";body {
background: #9e9e9e;
}
```