Comments (8)
Thanks for the detailed report. I know there are some race conditions where the require.js configuration won't yet be extracted at the time when the require
/define
calls are resolved. Could you try defining the require.js config in an inline script in your HTML instead using this syntax?
<script>
var require = {
paths:
backbone : 'vendor/backbone-amd/backbone'
deepmodel : 'vendor/deep-model'
...
};
</script>
<script src="/js/vendor/requirejs/require.js" data-main="/js/app"></script>
from assetgraph-builder.
That's a lot of stuff to jam into the index file. It's a sizable app. Can the race conditions be fixed? Based on the numerous examples Ive seen, this is a very common way apps are set up. If requirejs compatibility is a goal, this is important IMO.
from assetgraph-builder.
I agree, and it's certainly on my list. I asked you to try the above so I'd know whether this is a separate issue.
from assetgraph-builder.
Fair enough. Ill wire it up and let you know what happens
from assetgraph-builder.
Hmm, that turned out not to be the problem. I've created a stripped-down test case based on your description, and it does indeed look like the module names aren't resolved relative to your data-main
module. I'm working on a fix. In the mean time you can avoid the bug by using an explicit baseUrl
setting:
require.config {
baseUrl: '/js'
paths:
backbone : 'vendor/backbone-amd/backbone'
deepmodel : 'vendor/deep-model'
...
}
from assetgraph-builder.
@papandreou sorry I didn't get to the test before you did. the baseUrl does indeed bypass the problem for now. Thanks!
from assetgraph-builder.
No prob, had all the info I needed in your report. Fixed in 1.7.5.
from assetgraph-builder.
nice!
from assetgraph-builder.
Related Issues (20)
- Dedupe source maps HOT 1
- RSS feed link gets updated wrong
- When browsers list is not configured, look for it in package.json HOT 2
- Support .browserslistrc and browserslist key in package.json HOT 5
- Is it possible to wrap the built JS in a function to not expose define() ? HOT 4
- Throws when encountering Html Svg island with inline style HOT 1
- Generates invalid syntax from ES6 code HOT 4
- `node-zopfli` package seems no longer maintained HOT 5
- Ruby Sass is deprecated HOT 2
- Add `--preflight-check` cmdline option HOT 7
- `npm audit` complaints HOT 6
- Breaks await expression HOT 4
- Breaks relative ES6 module paths HOT 4
- ⚠ WARN: Cannot read property 'length' of null HOT 2
- [Q] CHANGELOG? HOT 4
- make assetgraph to not process svg HOT 2
- Translation not working HOT 1
- How to customize? HOT 3
- a vulnerability CVE-2020-7598 is introduced in assetgraph-builder
- Svgo is not a constructor HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assetgraph-builder.