ERROR in ./src/components/store/microhomecreate.js Module build failed: SyntaxError: E:/WorkSpace/html_workspace/zent.1yuezi.com/src/components/store/microhomecreate.js: Unexpected token (71:20) 69 | { 70 | type: configConf.type, > 71 | ...ConfigEditor.getInitialValue() | ^ 72 | } 73 | ] 74 | };
老师,帮我看看,是什么情况,这个不识别。
下面是我的配置文件
var debug = process.env.NODE_ENV !== "production"; var webpack = require('webpack'); var path = require('path'); module.exports = { //context: path.resolve('./src'), context: path.resolve(__dirname, './src'), devtool: debug ? "inline-sourcemap" : null, entry: "./main.js", module: { loaders: [ { test: /\.js?$/, exclude: /(node_modules)/, loader: 'babel-loader', query: { presets: ['react', 'es2015'], plugins: ['react-html-attrs'], //添加组件的插件配置 } }, //下面是使用 ant-design 的配置文件 { test: /\.css$/, loader: 'style-loader!css-loader' } ] }, output: { path: path.resolve('./'), filename: "bundle.js" }, plugins: debug ? [] : [ new webpack.optimize.DedupePlugin(), new webpack.optimize.OccurenceOrderPlugin(), new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), ], devServer: { historyApiFallback: true, port: 88 } };
下面是我的包
{ "name": "zent.1yuezi.com", "version": "1.0.0", "description": "1yuezi.com", "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "webpack-dev-server" }, "author": "Huan", "license": "ISC", "dependencies": { "antd": "^2.13.9", "babel-core": "^6.26.0", "babel-loader": "^6.4.1", "babel-plugin-react-html-attrs": "^2.0.0", "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babelify": "^8.0.0", "css-loader": "^0.28.7", "fetch": "^1.1.0", "json-loader": "^0.5.7", "react": "^16.0.0", "react-dom": "^16.0.0", "react-responsive": "^3.0.0", "react-router": "^4.2.0", "react-router-dom": "^4.2.2", "style-loader": "^0.19.0", "webpack": "^3.8.1", "webpack-dev-server": "^2.9.4", "zent": "^3.9.5" } }
轻松入门 React 开发,React Router 4 与 Webpack 2 完美升级项目
了解课程