1
を反応させ、モックアッププロジェクトを作成したが、私は、私は次のエラーを取得するプロジェクトを実行すると、私のwebpack.config.jsファイルコードがある予期しないトークンの輸入は、中に開始私は反応勉強
module.exports = {
entry: './client.js',
output: {
filename: 'bundle.js',
path: 'public'
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
}]
}
};
私のpackage.jsonファイル、
{
"name": "universal-react",
"version": "0.0.0",
"description": "Universal React web application.",
"scripts": {
"start": "webpack && node server.js",
"dev": "npm-run-all --parallel watch:*",
"watch:webpack": "webpack -w",
"watch:server": "nodemon --ext js,jsx --ignore public/ server.js"
},
"main": "server.js",
"keywords": [
"universal",
"react"
],
"dependencies": {
"babel-core": "^6.9.0",
"babel-loader": "^6.2.4",
"babel-preset-react": "^6.5.0",
"babel-register": "^6.9.0",
"express": "^4.13.4",
"marked": "^0.3.6",
"react": "^15.0.2",
"react-dom": "^15.0.2",
"react-redux": "^4.4.6",
"react-router": "^2.8.1",
"redux": "^3.6.0",
"webpack": "^1.13.1"
},
"devDependencies": {
"nodemon": "^1.11.0",
"npm-run-all": "^3.1.2"
}
}
/home/user/Documents/test/src/routes/index.js:1
(function (exports, require, module, __filename, __dirname) { import React from 'react';
^^^^^^
SyntaxError: Unexpected token import
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at loader (/home/user/Documents/src/node_modules/babel-register/lib/node.js:144:5)
私は間違っているところ誰も私を提案してもらえますか?
まだ同じです – Idlliofrio
node.jsのどのバージョンを使用していますか? – WitVault
私はノードv6.9.5を使用しています – Idlliofrio