This is my webpack-config.js:
module.exports = {
entry: "./src/js/main.js",
output: {
path: './dist',
filename: 'bundle.js',
publicPath: './dist'
},
devServer:{
inline: true,
contentBase: './dist'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader:'babel',
query: {
presets: ['es2015', 'react']
}
}
]
}
}
I created simple component App.js:
import React from 'react';
export default class App extends React.Component{
render(){
return <h1>Hello</h1>
}
}
and my main.js:
import React from 'react';
import { render } from 'react-dom';
import App from './components/App.js';
render(<App/>, document.getElementById('main'));
My index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="main"></div>
<script src="bundle.js">,/scrip>
</body>
</html>
when I run webpack-dev-server, there is no errors, it is serve right folder , but I see empty page, with no errors in the WEB console.
I see it loads the right file with id main, but thats all.
Where is the problem ?
index.html?I see it loads the right file with id main<script src="bundle.js">in the index?<script src="bundle.js">,/scrip>should be<script src="bundle.js"></script>?