mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-28 06:23:41 +05:30
Remove old logic for @import resolving
This commit is contained in:
parent
9b00815f96
commit
60a006b112
@ -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;
|
|
||||||
}
|
|
@ -8,7 +8,6 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|||||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
var cssUrl = require('webpack-utils/cssUrl');
|
var cssUrl = require('webpack-utils/cssUrl');
|
||||||
var cssImport = require('postcss-import');
|
var cssImport = require('postcss-import');
|
||||||
var iconfontImporter = require('webpack-utils/node-sass-iconfont-importer');
|
|
||||||
|
|
||||||
var vendor = Object.keys(require('./package.json').dependencies);
|
var vendor = Object.keys(require('./package.json').dependencies);
|
||||||
|
|
||||||
@ -118,7 +117,6 @@ var webpackConfig = {
|
|||||||
devtool: isTest ? 'inline-source-map' : 'eval',
|
devtool: isTest ? 'inline-source-map' : 'eval',
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new iconfontImporter.Plugin(),
|
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
|
||||||
@ -202,12 +200,6 @@ var webpackConfig = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
sassLoader: {
|
|
||||||
importer: iconfontImporter({
|
|
||||||
test: /\.font.(js|json)$/
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
postcss() {
|
postcss() {
|
||||||
return [
|
return [
|
||||||
cssImport({
|
cssImport({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user