static-site-generator-webpack-plugin: Export from "app" must be a function that returns an HTML string

Here’s a repo that reproduces the issue: https://github.com/sidjain26/static-react-issue

Note: This is using webpack v2.1, babel v6, react v15, react-router v2.4

Run

npm i
npm run build

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 21 (9 by maintainers)

Most upvoted comments

I saw your comment and pull request. In order to leverage tree shaking one needs to disable module syntax transformation.

webpack 2 natively supports ES6 import and export statements. webpack 2 leverages the static structure of the ES6 modules to perform tree shaking.

More info: https://github.com/gajus/babel-preset-es2015-webpack

@ahoereth Oh nice, I missed your comment while going through this. Also, that is exactly what I did in the original PR but I modified it to just check for default, since if __esModule is own property then, so will be default. So didn’t make sense to check for both.