We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
下图是我的 webpack.config.js
const webpack = require('atool-build/lib/webpack'); module.exports = function (webpackConfig, env) { webpackConfig.babel.plugins.push('transform-runtime'); //babel-plugin-import 是用来按需加载 antd 的脚本和样式的 webpackConfig.babel.plugins.push(['import', { libraryName: 'antd', style: 'css', }]); // Support hmr if (env === 'development') { webpackConfig.devtool = '#eval'; webpackConfig.babel.plugins.push('dva-hmr'); } else { webpackConfig.babel.plugins.push('dev-expression'); webpackConfig.plugins.some(function(plugin, i) { if (plugin instanceof webpack.optimize.UglifyJsPlugin) { webpackConfig.plugins.splice(i, 1); return true; } }); var os = require('os'); var options = { workers: os.cpus().length, output: { ascii_only: true, }, compress: { warnings: false, }, sourceMap: false } var UglifyJsParallelPlugin = require('webpack-uglify-parallel'); webpackConfig.plugins.push( new UglifyJsParallelPlugin(options) ); } // Don't extract common.js and common.css webpackConfig.plugins = webpackConfig.plugins.filter(function (plugin) { return !(plugin instanceof webpack.optimize.CommonsChunkPlugin); }); // Support CSS Modules // Parse all less files as css module. webpackConfig.module.loaders.forEach(function (loader, index) { if (typeof loader.test === 'function' && loader.test.toString().indexOf('\\.less$') > -1) { loader.include = /node_modules/; loader.test = /\.less$/; } if (loader.test.toString() === '/\\.module\\.less$/') { loader.exclude = /node_modules/; loader.test = /\.less$/; } if (typeof loader.test === 'function' && loader.test.toString().indexOf('\\.css$') > -1) { loader.include = /node_modules/; loader.test = /\.css$/; } if (loader.test.toString() === '/\\.module\\.css$/') { loader.exclude = /node_modules/; loader.test = /\.css$/; } }); webpackConfig.module.loaders.push({ test : /\.woff/, loader : 'url?prefix=font/&limit=10000&mimetype=application/font-woff' }) webpackConfig.module.loaders.push({ test : /\.ttf/, loader : 'file?prefix=font/' }) webpackConfig.module.loaders.push({ test : /\.eot/, loader : 'file?prefix=font/' }) webpackConfig.module.loaders.push({ test : /\.svg/, loader : 'file?prefix=font/' }) return webpackConfig; };
The text was updated successfully, but these errors were encountered:
问题有点宽泛 - 请查看个人 blog soda-x/blog#1
Sorry, something went wrong.
No branches or pull requests
下图是我的 webpack.config.js
The text was updated successfully, but these errors were encountered: