-1
我发现这个代码在线创建一个webpack反应..这里究竟发生了什么?我需要这样的能够使用反应的权利?我很困惑。配置React webpack.config.js
const path = require('path');
const SRC_DIR = path.resolve(__dirname, 'client');
const BUILD_DIR = path.resolve(__dirname, 'client');
module.exports = {
entry: path.resolve(SRC_DIR, 'client-app.js'),
output: {
filename: 'bundle.js',
path: BUILD_DIR
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: [/node_modules/],
use: [{
loader: 'babel-loader',
options: { presets: ['es2015', 'react'] }
}],
}
]
}
}
为什么它要求我添加一些上下文?我想增加更多的细节,因此,这个问题可以发布
这包装你的JSX和ES6代码的Web与装载机。 – Li357