@@ -8,17 +8,17 @@ David Walsh's [super simple loader](https://davidwalsh.name/javascript-loader) f
88npm i -S @prepair/basic-loader
99```
1010
11- * Requires browser environment (dom).
12- * Transpiled to es2015+ie context (polyfills not included).
11+ - Requires browser environment (dom).
12+ - Transpiled to es2015+ie context (polyfills not included).
1313
1414## usage
1515
1616```
1717import load from '@prepair/basic-loader'
1818
1919Promise.all([
20- load.js('lib/highlighter.js'),
21- load.js('lib/main.js'),
20+ load.js('lib/highlighter.js'),
21+ load.js('lib/main.js'),
2222 load.css('lib/highlighter.css'),
2323 load.img('images/logo.png')
2424]).then(() => {
@@ -28,18 +28,27 @@ Promise.all([
2828});
2929```
3030
31+ ## add optional attributes
32+
33+ ```
34+ load.js('lib/main.js', {
35+ 'data-foo': 'new-attribute',
36+ 'data-bar': 'new-attribute-2'
37+ })
38+ ```
39+
3140## caveats
3241
33- * Loading is not sequential of course. In the above example "main.js" may be parsed
42+ - Loading is not sequential of course. In the above example "main.js" may be parsed
3443 before "highlighter.js". If you want in order loading, use a sequential promise
3544 executor or a then chain.
36- * Style loading may not work with very old mobile borwsers.
45+ - Style loading may not work with very old mobile borwsers.
3746 [ Followup is here] ( https://github.com/w3core/import.js/issues/2 ) , see addendum below.
38- * The e2e test runner breaks (in phantom, but the test.html works in the browser)
47+ - The e2e test runner breaks (in phantom, but the test.html works in the browser)
3948 this is caused by an old phantomjs version in the _ mocha-phantomjs_ package.
4049 [ Issue is here] ( https://github.com/nathanboktae/mocha-phantomjs/issues/248 ) . Solutions:
41- * either wait for the upstream package to be updated
42- * or update the binary manually (inside node_modules)
50+ - either wait for the upstream package to be updated
51+ - or update the binary manually (inside node_modules)
4352
4453## exposed test
4554
0 commit comments