【发布时间】:2015-03-11 13:15:54
【问题描述】:
为了澄清 - 这是一个关于写webpack plugin的问题
如何在 webpack 插件中使用 webpack require?
MyPlugin.prototype.apply = function(compiler) {
var self = this;
compiler.plugin('emit', function(compilation, callback) {
var file = 'example.css';
compilation.fileDependencies.push(file);
var loaderResult = require('style!css!' + file); // <-- is there any way to make this possible?
});
};
【问题讨论】:
标签: javascript webpack