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.

Webpack 4 support?

See original GitHub issue

Hi there,

i’m currently upgrading to webpack 4 and i’m using the static-site-generator-webpack-plugin for my build. It currently errors with the following output:

ERROR in SyntaxError: Unexpected token .
    at module.exports (/Users/anon/gitrepos/myproject/node_modules/eval/eval.js:68:18)
    at /Users/anon/gitrepos/myproject/node_modules/static-site-generator-webpack-plugin/index.js:42:22

I’m not really sure if it has anything to do with your plugin, but the stacktrace points to eval, one dependency of this plugin.

Maybe it has to do something with the way webpack 4 handles module.exports?

Any help would be appreciated 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
Ambrooscommented, May 16, 2018

@Mydayyy You can use the package directly from my pull request temporarily, it’ll stay available.

yarn add --dev static-site-generator-webpack-plugin@medialaan/static-site-generator-webpack-plugin#58524c0

# or

npm install --save-dev static-site-generator-webpack-plugin@medialaan/static-site-generator-webpack-plugin#58524c0
5reactions
richsilvcommented, Apr 12, 2018

For what it’s worth, I believe there is a problem when using this with the new mini-css-extract-plugin.

It seems to assume that the main bundle to evaluate in each chunk will be the first entry in the array where there are multiple files per chunk, as there would be using that plugin. Unfortunately, this isn’t the case, as the output is of the form ["chunkName.css", "chunkName.js"], which leaves the static-site-generator plugin trying to evaluate the CSS.

Would a simple Array.find to pull out the javascript filename in this case be a satisfactory fix? Happy to PR if so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly ... it's recommended to update to the latest version...
Read more >
Upgrading Webpack 4 → 5 | Square Corner Blog
However, it only supported up to Webpack 4 and the project had been deprecated with no alternative recommendations.
Read more >
Webpack 4.0 Release: What's New? - Auth0
For this reason, Webpack 4 now supports WebAssembly out of the box. In Webpack 4, you can import and export any local WebAssembly...
Read more >
A Beginner's Guide to Webpack 4. In IT world, change is that ...
js'); console.log('App Version:', config.version);. The browser doesn't support require() , so ...
Read more >
Webpack 4 | Mobify DevCenter
Upgrading to webpack 4 can significantly improve a project's build time. ... Supported browser list is provided within package.json. - autoprefixer().
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