Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading path will be wrong when use es2015 babel by amd mode! #361

Closed
varlinor opened this issue Jul 30, 2018 · 1 comment
Closed

Loading path will be wrong when use es2015 babel by amd mode! #361

varlinor opened this issue Jul 30, 2018 · 1 comment

Comments

@varlinor
Copy link

varlinor commented Jul 30, 2018

I write a module that use Spin.js with es2015 syntax,
when I babel script to es5 syntax, and load the module by requirejs, then the error will be throw like below:

GET http://localhost:63342/MyProject/test/spin.js 404 (Not Found)
# my entry file is in test dir; 

My project dir structure is like below:

project
-src
--module
--app.js
-dist
--module
--app-XXXX.js
-test
--require.config.js
--index.html
-vendor
--require
--jquery
--spin

this situation is caused by spin.js module name;
the script after babel process will like below:

define(['exports', 'lodash', 'jquery', 'spin.js'], function (exports, _lodash, _jquery, _spin) {
    'use strict';
......

so, requirejs will load spin.js as a relative path based on index.html

Will you fix this bug sooner or later?

@theodorejb
Copy link
Collaborator

If a loader can't handle project names that contain a dot, that's a bug with the loader rather than the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants