const path = require('path'); const fs = require('fs'); const autoPrefixer = require('autoPrefixer'); const appDirectory = fs.realpathSync(process.cwd()); const loaders = require('../config/loader.dev'); const lessToJs = require('less-vars-to-js'); const themeVariables = lessToJs( fs.readFileSync(path.resolve(appDirectory, 'src/styles/ant-default-vars.less'), 'utf8') ); themeVariables['@icon-url'] = `${path.relative('./~/antd/lib/style/*', './src/styles/iconfont/antd-font/iconfont')}`; module.exports = { resolve: { modules: [path.resolve(appDirectory, 'src'), path.resolve(appDirectory, 'node_modules')], extensions: ['.jsx', '.js', '.scss', '.css', '.json'], }, module: { rules: [ loaders.cssLoaderRule, loaders.scssLoaderRule, loaders.lessLoaderRule, loaders.svgSpriteLoader, loaders.fontWoffLoader, loaders.fontTtfLoader, loaders.imageLoader, loaders.mediaLoader, ], }, };