Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gwuhaolin/babel-plugin-replace-require-suffix
replace file suffix in require(filepath.suffix)
https://github.com/gwuhaolin/babel-plugin-replace-require-suffix
babel plugin
Last synced: about 1 month ago
JSON representation
replace file suffix in require(filepath.suffix)
- Host: GitHub
- URL: https://github.com/gwuhaolin/babel-plugin-replace-require-suffix
- Owner: gwuhaolin
- Created: 2016-12-24T07:06:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-24T07:09:09.000Z (about 8 years ago)
- Last Synced: 2024-10-30T03:44:05.531Z (3 months ago)
- Topics: babel, plugin
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# babel-plugin-replace-require-suffix
replace file suffix in `require("filepath.suffix")`## install
```bash
npm i babel-plugin-replace-require-suffix --save-dev
```## example
#### replace `require('index.scss')` to `require('index.css')`
babel config
```json
{
"plugins": [
[
"replace-require-suffix",
{
"from": "scss",
"to": "css"
}
]
]
}
```
org code
```js
require('./index.scss');
```
out code
```js
require('./index.css');
```