webpack.config.js를 이렇게 작성하면
module.exports = {
entry: './index.jsx',
output: {
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}]
}
};
그리고 모듈을 index.jsx가져옵니다.reactApp
import React from 'react';
import { render } from 'react-dom';
import App from './containers/App';
let rootElement = document.getElementById('box')
render(
<App />,
rootElement
)
에서 module app이라는 이름을 지정하면 App.jsxwebpack은 in't index.jsxfind module 이라고 말하지만에서 App이름을 지정한 module app이라는 이름을 지정 App.js하면이 모듈을 찾아 잘 작동합니다.
그래서 나는 그것에 대해 혼란 스럽습니다. 내 webpack.config.js에서 test: /\.jsx?$/파일을 확인하기 위해 작성했지만 왜 named *.jsx를 찾을 수 없습니까?

rule아래에 나열된의module...{ module: { rules: [ { test: /\.jsx?$/, resolve: { extensions: [".js", ".jsx"] }, include: ... } ] }