Remove old logic for @import resolving

This commit is contained in:
SleepWalker 2016-07-23 15:32:48 +03:00
parent 9b00815f96
commit 60a006b112
2 changed files with 0 additions and 42 deletions

View File

@ -1,34 +0,0 @@
var loaderUtils = require("loader-utils");
module.exports = function createImporter(options) {
return function(url, fileContext, done) {
if (options.test.test(url)) {
var request = loaderUtils.urlToRequest(url);
loaderContext.loadModule(request, function(err, source) {
if (err) return done(new Error(err));
done({
contents: loaderContext.exec(source)
});
});
} else {
done(false);
}
};
};
var loaderContext;
var Plugin = module.exports.Plugin = function() {};
Plugin.prototype.apply = function(compiler) {
compiler.plugin('compilation', function(compilation) {
compilation.plugin('normal-module-loader', setLoaderContext);
});
};
function setLoaderContext(instance) {
// inject loaderContext instance for importer function
loaderContext = instance;
}

View File

@ -8,7 +8,6 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var cssUrl = require('webpack-utils/cssUrl');
var cssImport = require('postcss-import');
var iconfontImporter = require('webpack-utils/node-sass-iconfont-importer');
var vendor = Object.keys(require('./package.json').dependencies);
@ -118,7 +117,6 @@ var webpackConfig = {
devtool: isTest ? 'inline-source-map' : 'eval',
plugins: [
new iconfontImporter.Plugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
@ -202,12 +200,6 @@ var webpackConfig = {
}
},
sassLoader: {
importer: iconfontImporter({
test: /\.font.(js|json)$/
})
},
postcss() {
return [
cssImport({