mirror of
https://github.com/gregberge/loadable-components.git
synced 2026-01-18 15:12:26 +00:00
- Add a new `render` method to use render props pattern - Fix all issues with SSR BREAKING CHANGE: loadable-components/babel is now required if you do server side rendering. BREAKING CHANGE: ErrorComponent now receive `ownProps` instead of `props`.
50 lines
1.0 KiB
JavaScript
50 lines
1.0 KiB
JavaScript
const path = require('path')
|
|
|
|
module.exports = {
|
|
entry: './client.js',
|
|
output: {
|
|
path: path.resolve(__dirname, 'public'),
|
|
filename: 'bundle.js',
|
|
chunkFilename: '[name].bundle.js',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'babel-loader',
|
|
exclude: /node_modules/,
|
|
options: {
|
|
babelrc: false,
|
|
presets: [
|
|
'react',
|
|
[
|
|
'env',
|
|
{
|
|
targets: {
|
|
browsers: ['last 2 chrome versions'],
|
|
},
|
|
modules: false
|
|
},
|
|
],
|
|
],
|
|
plugins: [
|
|
'loadable-components/babel',
|
|
['transform-class-properties', { loose: true }],
|
|
'transform-object-rest-spread',
|
|
],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
devtool: 'sourcemap',
|
|
devServer: {
|
|
proxy: {
|
|
contentBase: path.resolve(__dirname, 'public'),
|
|
publicPath: '/',
|
|
'/': {
|
|
target: 'http://localhost:3000',
|
|
},
|
|
},
|
|
},
|
|
}
|