Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My entry chunk is renamed to an async chunk #78

Open
arnoldjos opened this issue Jul 13, 2018 · 2 comments
Open

My entry chunk is renamed to an async chunk #78

arnoldjos opened this issue Jul 13, 2018 · 2 comments

Comments

@arnoldjos
Copy link

I am having issues when adding magic comments to my dynamic import using react-reloadable, Instead of receiving "main" i get "Home" which is a loadable component.

Here is my server config.

const path = require('path');
const webpack = require('webpack');
const externals = require('./node-externals');
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');

module.exports = {
name: 'server',
target: 'node',
externals,
entry: './server/renderer.js',
mode: 'development',
output: {
filename: 'dev-server-bundle.js',
chunkFilename: '[name].js',
path: path.resolve(__dirname, '../build'),
libraryTarget: 'commonjs2'
},
devtool: 'inline-sourcemaps',
module: {
rules: [
{
test: /.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader'
}
]
},
{
test: /.css$/,
use: {
loader: 'css-loader',
options: {
minimize: true
}
}
},
{
test: /.scss$/,
use: [
{
loader: 'css-loader',
options: {
minimize: true
}
},
{
loader: 'postcss-loader'
},
{
loader: 'sass-loader'
}
]
},
{
test: /.(jpg|png|gif)$/,
use: [
{
loader: 'file-loader',
options: {
name: '/images/[name].[ext]',
emitFile: false
}
}
]
}
]
},
plugins: [
new FriendlyErrorsWebpackPlugin(),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development')
}
})
]
};

@threehams
Copy link

Webpack issue:
webpack/webpack#7516

@richardscarrott
Copy link
Member

@arnoldjos you could perhaps explicitly give your entry a name, e.g.

entry: {
   server: './server/renderer.js', // or main: './server/renderer.js'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants