Fairly new to webpack (sorry if this is kind of basic). From some searching, my understanding is that import
declarations are unnecessary if you have the required packages in your dependOn
in your webpack configuration. However, I get a ReferenceError: ReactDOM is not defined
with the following config.
What am I doing wrong?
webpack.config.js
module.exports = {
entry: {
reactVendors: ['react', 'react-dom'],
home: { import: path.join(__dirname, 'src', 'index.js'), dependOn: 'reactVendors' }
}
}
In my index.js
// removed import React from 'react' and import ReactDOM from 'react-dom' up here;
ReactDOM.render(<p>Hello</p>, document.getElementById('demo'));