webpack js loader for require in comment
Switch branches/tags
Nothing to show
Clone or download
halwu(吴浩麟)
halwu(吴浩麟) add doc
Latest commit 538f618 Dec 30, 2016
Permalink
Failed to load latest commit information.
index.js Initial commit Dec 30, 2016
package.json add doc Dec 30, 2016
readme.md add doc Dec 30, 2016
replace.js Initial commit Dec 30, 2016
replace.test.js Initial commit Dec 30, 2016

readme.md

webpack js loader for require in comment

install

npm i comment-require-loader --save-dev

use

webpack.config.js

module.exports = {
  module: {
    loaders: [
      {
        test: /\.js$/,
        loaders: ['comment-require-loader'],
        include: [path.resolve(__dirname, 'node_modules/imui')]
      }
    ]
  }
};

org file

// @require '../style/index.css'

output file

require('../style/index.css');

实际是这个插件用于在 webpack 构建环境里兼容使用 fis3 输出的带有// @require '***' 的文件