I need run create-react-app with file index.php in

2019-09-30 07:58发布

Execute npm run eject and rename index.php to index.html, but it does not work. I need to include a class inside index.php to use a function that converts data encrypt to send toward React.

1条回答
欢心
2楼-- · 2019-09-30 08:25

I found a solution,

First, execute:

npm run eject

then, change the code in paths.js to:

appHtml: resolveApp('public/index.php')

and webpack.config.dev.js (agree |php):

exclude: [/\.(js|jsx|mjs|php)$/, /\.html$/, /\.json$/]

after:

npm start

this works well

查看更多
登录 后发表回答