ОШИБКА в ./src/main.js
Ошибка сборки модуля (из ./node_modules/babel-loader/lib/index.js):
Ошибка синтаксиса: /Users/logurvp/Documents/GitHub/local/populardoctor_webapi/adminclient/src/main.js: неожиданный токен (5:16)
3 | импортировать приложение из ./App ';
4 |
5 | ReactDOM.render (, document.getElementById ('app'));
| ^
в Parser.raise (/Users/logurvp/Documents/GitHub/local/populardoctor_webapi/adminclient/node_modules/@babel/parser/lib/index.js:4051:15)
package.json
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"@babel/preset-es2015": "^7.0.0-beta.53",
"@babel/preset-react": "^7.0.0",
"html-webpack-plugin": "^3.2.0",
"sendotp": "^1.2.9"
},
webpackconfig
module.exports = {
entry: ['babel-polyfill', './src/main.js'],
devtool: 'sourcemaps',
output: {
path: path.join(__dirname, outputDirectory),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
}
]
},
devServer: {
port: 3000,
open: true,
proxy: {
'/api': 'http://localhost:5000'
}
},
plugins: [
new CleanWebpackPlugin([outputDirectory]),
new HtmlWebpackPlugin({
template: './src/index.html',
})
]
};