-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
R.js build fails with external resources defined in the "paths" config property #207
Comments
so how to solve this error? |
@linjinying, until my PR is merged or another fix is implemented, you can try replacing css-builder.js file with this one: https://raw.githubusercontent.com/dchekanov/require-css/bug-207/css-builder.js to fix the issue. |
@dchekanov ok,thanks~ |
Taken from RequireJS API
This means that you should declare a path definition beforehand: require.config({
paths: {
bootstrapCss: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min',
requireCssPath: '../../'
},
map: {
'*': {
'css': 'requireCssPath/css'
}
}
}); |
Thanks for the tip, @amenadiel. "../../css" mapping was actually working for me while testing, but maybe it would break in actual application. I copied |
@dchekanov Thank you for your css-builder.js file, it works fine on Windows but seems to have some issues on Linux? I ran a build with it on CentOS 7, but no css was included in js files. Everything is the same, but on Windows it just works fine, css was included in js files after optimization. Can you have a look at it? Thanks again for your work!
|
@xqxian Good catch, thanks. I replaced the previously used regex with a simple check if path includes "://" sub-string. Please give it a try. https://raw.githubusercontent.com/dchekanov/require-css/bug-207/css-builder.js |
@dchekanov I'm very sorry for the late reply, I've been busy with my project these days... Actually I replaced the 'absUrlRegEx' value with
after I've found the problem, and it works properly. I also tested the file you gave me above and it works fine too. Thank you for your work again! |
main.js:
build.js:
This happens because
css-builder.js
checks if the module name is an absolute URL but not if the final file URL is.I'll make a PR to fix this shortly.
The text was updated successfully, but these errors were encountered: