Module not found when import .jsx file
To import files in the same folder you have to use
./nameOfTheFile
Instead of
nameOfTheFile
So your important statement would be
import NavbarTemplate from './NavbarTemplate.jsx';
according with webpack can't find module if file named jsx if you don't want to add .jsx
on your import you could add resolve: { extensions: ['.js', '.jsx'] }
to your webpack.config
.
// ...
module: {
loaders: [
{
test: /\.jsx?$/,
include: path.join(__dirname, '/client/src'),
// loader: 'babel',
loader: 'babel-loader',
query: {
presets: ["react", "es2015"],
plugins: ["transform-class-properties"]
}
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
]
},
resolve: {
extensions: ['.js', '.jsx']
}
// ...
if your App.jsx and NavbarTemplate.jsx are in the same root directory then just try
import NavbarTemplate from './NavbarTemplate';
it should work