stereobooster / react-snap

👻 Zero-configuration framework-agnostic static prerendering for SPAs
MIT License
5.04k stars 391 forks source link

react-scripts/config/webpack.config.prod not found #464

Open gz89 opened 4 years ago

gz89 commented 4 years ago

Bug Report

Current Behavior I am trying to make React project to Preact without ejecting. I followed this documentation. But got an error.

Reproducible demo

process.env.NODE_ENV = "production"

const config = require("react-scripts/config/webpack.config.prod")

config.resolve.alias["react"] = "preact-compat"
config.resolve.alias["react-dom"] = "preact-compat"

require("react-scripts/scripts/build")

Expected behavior/code I hope this should be solved and update documentation.

Additional context/Screenshots This is the error log.

internal/modules/cjs/loader.js:955
  throw err;
  ^

Error: Cannot find module 'react-scripts/config/webpack.config.prod'