var webpack = require('webpack');
var path = require('path');
module.exports = {
context: path.join(__dirname, 'src'),
entry: ".src/js/index.js",
resolve: {
// 第一项空字符串必不可少,否则报模块错误
extensions: ['', '.es6','.js','.jsx']
},
module: {
loaders: [{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015']
},
}]
},
output: {
// path: path.resolve(__dirname, 'dist'),
path: __dirname,
filename:'./src/bundle.js'
}
}