-1

Hello and thank you for reading me.

I would like to deploy the aplication to GitHub Pages web server.

However, when I try to use the JavaScript it reports:

SyntaxError: import declarations may only appear at top level of a module

So then the Developer Tools reports that the errors are the imports:

    import CoreUtils from 'base/core/core.utils';
import LoadersVolume from 'base/loaders/loaders.volume';
import HelpersStack from 'base/helpers/helpers.stack';
import HelpersLut from 'base/helpers/helpers.lut';
import CamerasOrthographic from 'base/cameras/cameras.orthographic';
import ControlsOrthographic from 'base/controls/controls.trackballortho';

I have read that by defult Babel does not delete the imports and transpile the code.

I tried to fix it by myself reading: ES2015 import doesn't work (even at top-level) in Firefox

SyntaxError: import declarations may only appear at top level of a module

ES2015 module import and export syntax error

Even: https://github.com/framework7io/Framework7-Vue-Webpack-Template/issues/10

The fact is I have red the answers and some talk about editing the babelrc config file.

Somebody could help me please?

Enoy
  • 1,724
  • 3
  • 19
  • 39

1 Answers1

1

You can not just copy paste uncompiled code to be deployed:

1- Compile the example code: yarn dist:clean && yarn build:clean && yarn dist:ami && yarn dist:examples

2- In the dist directory, find the example you are interested in

3- Deploy the example

Hope that helps...

Nicolas
  • 1,913
  • 2
  • 22
  • 40