https://github.com/phaistonian/stylus-vars-loader
Inject your vars into webpack
https://github.com/phaistonian/stylus-vars-loader
loader stylus webpack
Last synced: 6 months ago
JSON representation
Inject your vars into webpack
- Host: GitHub
- URL: https://github.com/phaistonian/stylus-vars-loader
- Owner: phaistonian
- Created: 2017-03-11T19:01:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-01T04:54:26.000Z (about 9 years ago)
- Last Synced: 2025-02-28T23:48:48.538Z (over 1 year ago)
- Topics: loader, stylus, webpack
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This simple loader will prepend the file (or files) of your choice hosting your variables to stylus files.
For example, say you have an `index.js` file and you do this
`import './index.styl'`
then instead of always referencing your global `vars.styl` file from the `index.styl`, you can use the loader to do it for you.
### Install
`npm i -D stylus-vars-loader`
or
`yarn add stylus-vars-loader`
### Publish
`yarn version`
`git push`
`npm publish`
### Use
```js
{
test: /\.styl$/,
use: [
'style-loader',
'css-loader',
'stylus-loader',
{
loader: 'stylus-vars-loader',
options: {
file: './css/vars.styl',
// you can also do multiple files
file: ['./css/vars.styl', './css/media-queries.styl'],
// glob too
file: './css/vars/*',
},
},
]
}
```
---
Special thanks to [Juho](https://twitter.com/bebraw) for always sharing pointers when asked to.