Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/react-doc/raw-extend-loader
raw extend loader module for webpack
https://github.com/react-doc/raw-extend-loader
webpack-loader webpack3
Last synced: 18 days ago
JSON representation
raw extend loader module for webpack
- Host: GitHub
- URL: https://github.com/react-doc/raw-extend-loader
- Owner: react-doc
- Created: 2017-12-22T12:27:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-03T05:30:53.000Z (about 7 years ago)
- Last Synced: 2024-12-15T22:12:33.341Z (about 1 month ago)
- Topics: webpack-loader, webpack3
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Install
```bash
npm install --save-dev raw-extend-loader
```Usage
Use the loader either via your webpack config, CLI or inline.
### Via webpack config (recommended)
**webpack.config.js**
```js
module.exports = {
module: {
rules: [
{
test: /\.txt$/,
use: [
{
loader: require.resolve('raw-extend-loader'),
options: {
dir: '/path/md', // Copy to the '/path/md' directory.
filename: 'dir', // "underline | dir"
sep: '___', // filename="underline", File name to the directory, using '___' interval, default value '__'.
},
},
],
}
]
}
}
```### option
- `dir` Copy to the '/path/md' directory.
- `filename` Optional `underline | dir`, According to the directory to store, or do not create a directory.
- `sep` Set `filename="underline"`, File name to the directory, using `___` interval, default value `__`.**In your application**
```js
import txt from './file.txt';
```### CLI
```bash
webpack --module-bind 'txt=raw-extend-loader'
```**In your application**
```js
import txt from 'file.txt';
```### Inline
**In your application**
```js
import txt from 'raw-extend-loader!./file.txt';
```