The front-end of the DVA project development, encountered a very depressed problem, with ES6 syntax simple export a variable out, in other JS import use, the result is an error. The export is written as follows:
1 Const Enus = {2account: ' Account : ',3 password: ' Password: ' ,4 userlogin: "User Login"5}; 6 default Enus;
It doesn't seem to be a problem, does it? Import is written as follows:
1 import Enus from '. /.. /i18n/enus ';
It doesn't seem to be a problem, does it? However, in other JS in the import use will be error, the following errors:uncaught syntaxerror:unexpected Token exportReason: Check for half a day, the last discovery is because i18n file directory is not correct, this must be placed in the project SRC directory, otherwise webpack will not be recognized. Good pit.
Webpack does not recognize JS or CSS outside the SRC directory when it is packaged and compiled