linux构建web错误,升级2.1.0后Linux环境下构建出现Module build failed: Error: "extract-text-webpack-plugin"...

package.json

{

"private": true,

"entry": {

"index": "./src/entries/index.js"

},

"dependencies": {

"antd": "^2.1.0",

"dva": "^1.1.0",

"md5": "^2.2.1",

"moment": "^2.15.1",

"moment-timezone": "^0.5.6",

"react": "^15.3.2",

"react-dnd": "^2.1.4",

"react-dnd-html5-backend": "^2.1.2",

"react-dom": "^15.3.2",

"react-router": "^2.8.1",

"reqwest": "^2.0.5"

},

"devDependencies": {

"atool-test-mocha": "^0.1.6",

"atool-build": "^0.7.18",

"babel-plugin-dva-hmr": "^0.1.0",

"babel-plugin-transform-runtime": "^6.15.0",

"babel-plugin-import": "^1.0.1",

"babel-runtime": "^6.11.6",

"babel-plugin-dev-expression": "^0.2.1",

"dora-plugin-webpack": "^0.6.6",

"dora": "^0.3.3",

"dora-plugin-proxy": "^0.7.0",

"expect": "^1.20.2",

"dora-plugin-webpack-hmr": "^0.1.1",

"redbox-react": "^1.3.2"

},

"theme": {

"primary-color": "#ed6f21"

},

"scripts": {

"start": "dora --plugins \"proxy,webpack,webpack-hmr\"",

"build": "atool-build",

"test": "atool-test-mocha ./src/**/*-test.js"

}

}

webpack.config.js

const fs = require('fs');

const path = require('path');

module.exports = function(webpackConfig, env) {

webpackConfig.babel.plugins.push('transform-runtime');

webpackConfig.babel.plugins.push(['import', {

libraryName: "antd",

style: true

}]);

// Support hmr

if (env === 'development') {

webpackConfig.devtool = '#eval';

webpackConfig.babel.plugins.push(['dva-hmr', {

entries: [

'./src/entries/index.js',

],

}]);

} else {

webpackConfig.babel.plugins.push('dev-expression');

}

// 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$/;

}

});

//复制title小图标

var readStream = fs.createReadStream('./src/entries/favicon.ico');

var writeStream = fs.createWriteStream('./dist/favicon.ico');

readStream.pipe(writeStream);

return webpackConfig;

};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值