question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.0.2 breaks code splitting

See original GitHub issue

Updating from “^1.0.1” to “^1.0.2” has broken my code splitting. This shouldn’t be a breaking change from a patch update.

{
  test: /\.jsx?$/,
  include: [ APP, CONFIG, SERVER ],
  loader: 'babel-loader',
  options: {
    presets: [
      [ 'env', {
        targets: { browsers: [ 'last 2 versions' ] },
        modules: false,
      } ],
      'react',
    ],
    plugins: [
      'dynamic-import-webpack',
      'transform-export-extensions',
      'transform-decorators-legacy',
      'transform-class-properties',
      'transform-object-rest-spread',
      'add-module-exports',
      'lodash',
      'ramda',
      'react-require',
      [ 'provide-modules', {
        'debug': 'debug',
      } ],
      'babel-root-import',
    ],
  },
}

Also possibly worth note is:

  resolve: {
    modules: [ SRC, STYLES, 'node_modules' ],
    extensions: [
      '.js', '.jsx', '.scss',
    ],
  },

And using react-loadable/webpack

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
tomataucommented, Mar 23, 2018

I think I’ve found the problem. Babel is merging configs so a server side render that uses "dynamic-import-node" in a .babelrc is being merged into the webpack loader config… 😐

edit:

Thanks for the help everyone 😃 👍

0reactions
tomataucommented, Mar 23, 2018

@loganfsmyth there aren’t any errors when left out in development. The problem is that the code split chunks aren’t being created and so only the normal chunks are created without errors.

edit: also see my edits for https://github.com/airbnb/babel-plugin-dynamic-import-webpack/issues/42#issuecomment-375813672 I tried the syntax plugin to no avail 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code-splitting for libraries—bundling for npm with Rollup 1.0
Here I want to make the case for why this is a game-changer not only for the frontend but for libraries as well....
Read more >
Rollup now has code-splitting! And we need your help - Medium
Code-splitting breaks your app into smaller chunks, so that the user only has to load enough JavaScript to get started, and the application...
Read more >
Code-splitting with TypeScript and Webpack - David East
Code-splitting is a feature I'd pay for. It's amazing. Take one large JavaScript file and break it into smaller pieces with one keyword....
Read more >
Code Splitting - webpack
This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can...
Read more >
loadable-components | Yarn - Package Manager
loadable-components. owner smooth-code23.5kMITdeprecated2.2.3TS vulns 0 vulnerabilities. Please use @loadable/component. React code splitting made easy.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found