Can't resolve paths from index.html after npm run build
See original GitHub issueAfter building an app into /dist
folder index.html
references all resources (minified .css, .js and images) as /resource_name
instead of ./resources_name
. Manually replacing /
to ./
in webpack.config.prod.js:output.publicPath
or in index.html
fixes the problem.
Am I doing something wrong that I have to do it manually?
P.S. The issue does not affect the dist server.
Node version: 6.9.2
npm version: 3.10.9
Operating system: macOS 10.12.3
Command line used: npm run build (excluded linting and testing)
Steps to reproduce: npm run build
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Can't resolve paths from index.html after npm run build
I run this command to build my project: npm run build. but I cannot find index.html file and other .js files. my webpack.config.js...
Read more >Build & Deploy - Hands on React
npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a...
Read more >Creating a React app with Webpack - JavaScript Ramblings
Simple step by step walkthrough of setting up a React app with Webpack.
Read more >Using React with TypeScript - Mattermost
React is a JavaScript library that enables developers to build full-fledged applications in a modular structure.
Read more >Create React App: import modules using aliases ... - Wavelop
in this way, the Typescript compiler will be able to resolve paths. Reorganize the files. Now we are going to re-organize the file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created a short note in FAQ on this topic.
I agree that a deploy section would be useful, and likely expose us to opportunities for improvement. I’d welcome a related PR.