September 2018
Beginner
156 pages
3h 28m
English
The existing webpack configuration builds the server-side application and runs the nodemon utility to monitor the changes. To generate a client-side bundle, we need to include another webpack configuration file—webpack-client.config.babel.js:
import path from 'path';import webpack from 'webpack';export default { entry: './src/client/index.js', output: { path: path.resolve(__dirname, './dist/public'), filename: 'bundle.js', publicPath: '/' }, module: { rules: [ { test: /\.js$/, use: 'babel-loader' } ] }, plugins: [ new webpack.DefinePlugin({ __isBrowser__: "true" }) ]}
The preceding configuration resolves the dependencies in the /src/client/index.js file and creates a bundle at /dist/public/bundle.js. This bundle contains ...
Read now
Unlock full access