https://github.com/gwuhaolin/comment-require-loader
webpack js loader for require in comment
https://github.com/gwuhaolin/comment-require-loader
loader webpack
Last synced: 8 months ago
JSON representation
webpack js loader for require in comment
- Host: GitHub
- URL: https://github.com/gwuhaolin/comment-require-loader
- Owner: gwuhaolin
- Created: 2016-12-30T03:48:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-30T07:42:09.000Z (over 9 years ago)
- Last Synced: 2025-05-07T23:38:32.479Z (about 1 year ago)
- Topics: loader, webpack
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# webpack js loader for require in comment
## install
```bash
npm i comment-require-loader --save-dev
```
## use
**webpack.config.js**
```js
module.exports = {
module: {
loaders: [
{
test: /\.js$/,
loaders: ['comment-require-loader'],
include: [path.resolve(__dirname, 'node_modules/imui')]
}
]
}
};
```
**org file**
```js
// @require '../style/index.css'
```
**output file**
```js
require('../style/index.css');
```
实际是这个插件用于在 webpack 构建环境里兼容使用 fis3 输出的带有`// @require '***'` 的文件