What are the pieces of the web pack from reactive downloads?

I successfully added a library project with reaction loading to the project to allow code separation, the only problem I found was that the pieces created by the web package are not called, they are given whole names.

My code for use with reaction is

const AppRootLoadable = Loadable({
  loader: () => import(/* webpackChunkName: "app" */ './App'),
  loading: () => null,
  render(loaded) {
    const Component = loaded.default;
    return <Component />;
  },
});

I added a comment to tell webpack 3 that I want this piece to be called an application. Did I do something wrong?

+4
source share
1 answer

Well, after 4 days I found a solution. I needed to add the chunkFilename line to my webpack configuration:

output: {
  path: path.join(__dirname, './../public'),
  filename: 'bundle.js',
  publicPath: '/',
  chunkFilename: '[name].[chunkhash].js'
},

Then it works. I found it on the webpack github page

+3
source

Source: https://habr.com/ru/post/1686955/


All Articles