https://github.com/retailmenotsandbox/roux-resolver-webpack-plugin
Webpack resolver plugin for resolving entrypoints within a roux pantry
https://github.com/retailmenotsandbox/roux-resolver-webpack-plugin
Last synced: over 1 year ago
JSON representation
Webpack resolver plugin for resolving entrypoints within a roux pantry
- Host: GitHub
- URL: https://github.com/retailmenotsandbox/roux-resolver-webpack-plugin
- Owner: RetailMeNotSandbox
- License: mit
- Created: 2016-09-23T20:44:30.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T04:33:36.000Z (over 3 years ago)
- Last Synced: 2024-04-14T12:21:56.724Z (about 2 years ago)
- Language: JavaScript
- Size: 1.62 MB
- Stars: 0
- Watchers: 7
- Forks: 3
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @retailmenot/roux-resolver-webpack-plugin
Webpack resolver plugin for resolving entrypoints within a
roux pantry.
[](https://travis-ci.org/RetailMeNotSandbox/roux-resolver-webpack-plugin)
## Installation
```sh
npm install @retailmenot/roux-resolver-webpack-plugin
```
## Usage
Add the following to your webpack config.
```
var RouxResolverWebpackPlugin = require( '@retailmenot/roux-resolver-webpack-plugin' );
{
// rest of webpack config
plugins: [
new webpack.ResolverPlugin( [
new RouxResolverWebpackPlugin()
] )
]
}
```
This should enable you to `require` files within roux pantries using their ingredient name. e.g. `require('@namespace/pantry/path/to/ingredient')` will get you the JS entrypoint for the ingredient named by
`@namespace/pantry/path/to/ingredient`.
You can add a query string to your require statements to resolve filetypes other than the js entrypoint. e.g.
`require('@namespace/pantry/path/to/ingredient?entry=sass')` will get you the
scss entrypoint for the ingredient named by
`@namespace/pantry/path/to/ingredient`.
## Tests
Run unit tests with `npm run test`