我是新手使用webpack,在捆绑之后我的文件大小超过500kb
只有以下内容:
import React, { Component } from 'react';
class App extends Component {
return(
<div>
<h1>Hello World</h1>
</div>
);
}
ReactDOM.render( <App />, document.getElementById('main') );
我说的不正常。我的webpack配置:
module.exports = {
entry: path.resolve(__dirname, 'src') + '/app/index.jsx',
output: {
path: path.resolve(__dirname, 'dist') + '/bundled',
filename: 'bundle.js',
publicPath: '/bundled/'
},
module: {
loaders: [
{
test: /\.jsx$/,
include: path.resolve(__dirname, 'src'),
loader: 'babel-loader',
query: {
presets: ['react', 'es2015'],
plugins: ['transform-class-properties']
}
}
]
}
};
我有什么遗漏导致这个更大的文件大小?