peerigon/parse-domain

Upgrade to 3.0.0 won't build - Failed to minimize

liron-strattic opened this issue · 6 comments

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

./node_modules/parse-domain/build-esm/src/sanitize.js:24

Running with the following when building:

    "react": "^16.4.1",

    "react-app-rewired": "^1.5.2",
    "yarn": "^1.7.0"

#26

Seems related to this bug from a previous version.

jhnns commented

Thanks for reporting this. As the README says, parse-domain now assumes an ES2015 environment. You need to transpile it down to ES5 if you need to support older browsers.

Do you know what syntax exactly is causing the issue? What minifier do you use?

jhnns commented

Btw: The issue is caused by an arrow function (=>). Seems like you're using UglifyJS (which only supports ES5 input) and your build pipeline does not transpile parse-domain down to ES5. Either transpile it down to ES5 or use an ES2015-compliant minifier like Terser

Thanks. We'll look into upgrading our systems.

We came across the error because we had to upgrade from the 2.x version because the last 2.x build was including dev dependencies as non-dev dependencies.

Any chance you can issue an upgraded 2.3.5 which removes 'jest' as one of the primary dependencies?

jhnns commented

No, because jest is executed after postinstall to verify that the build works (we used to download the list automatically on postinstall). If we removed it, you would get an error. Why is jest a problem? It's not used in production code, only during build time.