You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
To test and understand how to use the plugin, I am just trying to import a module as a dependency in the code used by test/manual.html. Despite having read the documentation of Babel, SystemJS and plugin-babel, trying different configuration options, I have never managed to make it work.
So here the simplest case based on the current code of the test:
Added test/foo-mod.js:
exportdefaultvarfoo=7;
Modified test/manual.js:
importfoofrom'./foo-mod';// --> 404 Not Found//import foo from './foo-mod.js'; // --> Unexpected token (1:15)exportvarp=5;
The first line throws Not Found whereas the path is correct (except for the .js extension). The second one throws unexpected token when .js is explicitely added.
Isn't the specific build of Babel of this plugin supposed to make this work out of the box? Is there any additional preset or plugin to enable? What am I missing?
The text was updated successfully, but these errors were encountered:
gentooboontoo
changed the title
Cannot import a module when using the test example code
Cannot import a module when using the browser test example code
Sep 29, 2016
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
To test and understand how to use the plugin, I am just trying to import a module as a dependency in the code used by
test/manual.html
. Despite having read the documentation of Babel, SystemJS and plugin-babel, trying different configuration options, I have never managed to make it work.So here the simplest case based on the current code of the test:
Added
test/foo-mod.js
:Modified
test/manual.js
:The first line throws
Not Found
whereas the path is correct (except for the.js
extension). The second one throwsunexpected token
when.js
is explicitely added.Isn't the specific build of Babel of this plugin supposed to make this work out of the box? Is there any additional preset or plugin to enable? What am I missing?
(I have made a branch in my fork with the above changes for reproducing purpose: https://github.com/gentooboontoo/plugin-babel/tree/import-test).
The text was updated successfully, but these errors were encountered: