В чем может быть ошибка?
webpack.config.js
'use strict'
const path = require('path');
module.exports = {
entry: './main.js',
output: {
filename: 'build.js'
},
module: {
rules: [{
loader: 'babel-loader',
options: {
presets: ['es2015']
}
}]
},
resolve: {
modules: [
'node_modules',
path.resolve(__dirname, '/')
],
extensions: [".js", ".json", ".jsx", ".css"]
}
}
main.js
import React from 'react'
import ReactDOM from 'react-dom'
import Babel from 'babel'
const $header = document.getElementById('header');
class Navigation extends React.Component {
render() {
return (
<nav>
<a href="">1-link</a>
<a href="">2-link</a>
<a href="">3-link</a>
<a href="">4-link</a>
<a href="">5-link</a>
</nav>
);
}
}
ReactDOM.render(<Navigation />, $header);
package.json
{
"name": "reactjs",
"version": "1.0.0",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "wasya1212",
"license": "ISC",
"description": "simple webpack react project",
"dependencies": {
"babel": "^6.23.0",
"react": "^15.6.1",
"react-dom": "^15.6.1"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.8.2"
}
}