0

使用 Webpack,并遵循survivorjs 教程。

我已经成功跑了

npm run build

并在构建目录中获得了 index.html 和 bundle.js。

当我尝试将这些放在我的服务器文件夹中并运行 index.html 时,我收到以下错误:

Uncaught SyntaxError: Unexpected token { 
From bundle.js:2

我的 web 文件夹可以显示 html 文件。

可能是什么原因,我应该如何以最简单的方式将我的反应应用程序部署到服务器?

4

1 回答 1

0

Thanks everyone! Found what was the cause...

Apparently there were files required in a few files that had an uppercase on the first letter and for some reason on my local host it managed to pass build, but on the remote server it couldn't... strange!

Thanks

于 2015-07-27T17:02:48.153 回答