react-example icon indicating copy to clipboard operation
react-example copied to clipboard

Production Build without dev-server not working

Open emasch opened this issue 8 years ago • 1 comments

When I commented out the fuse.dev() in the dist-Task, the produced output is not working. My dist-Task looks like this:

Sparky.task('dist', ['prod-env', 'config'], () => {
  // comment out to prevent dev server from running (left for the demo)
  // fuse.dev();
  return fuse.run();
});

The output in the index.html file in the dist directory which is produced is this one:

<!DOCTYPE html>
<html>

<head>
  <title>Test</title>
</head>

<body>
  <div id="root"></div>
  <script  type="text/javascript" src="/28e01eb1-api.js"></script>
  <script  type="text/javascript" src="/81fba5dd-vendor.js"></script>
  <script  type="text/javascript" src="/25e16468-app.js"></script>
</body>

</html>

But in the <script src=""> tag it has to be ./28e01eb1-api.js with a dot (.) to work.

If i commented in the run.dev() command, it works. So there seems to be a difference if I start it from a file or with the run.dev() command.


Also there is something left from the babel Plugin. In the fuse.js on line 6 there's still the BabelPlugin left. It seems to be unused.

emasch avatar Jan 01 '18 14:01 emasch

Please, take a look here https://fuse-box.org/plugins/web-index-plugin#options

path : "." (that will make it empty) or whatever suits you better

nchanged avatar Jan 01 '18 19:01 nchanged