Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #64 from alleyinteractive/bug/dataset-compatibility
Browse files Browse the repository at this point in the history
Add getAttribute as a fallback for dataset.
  • Loading branch information
Pattie Reaves authored Dec 16, 2016
2 parents 25c8ebc + 05cec31 commit 844c20f
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 32 deletions.
5 changes: 4 additions & 1 deletion dist/cli/require-templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cli/require-templates.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 42 additions & 8 deletions dist/web/huron.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web/huron.js.map

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions src/cli/require-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const huronScript = fs.readFileSync(

/**
* Write code for requiring all generated huron assets
* Note: prepended and appended code in this file should roughly follow es5 syntax for now,
* as it will not pass through the Huron internal babel build nor can we assume the user is
* working with babel.
*
* @function requireTemplates
* @param {object} store - memory store
Expand All @@ -25,9 +28,9 @@ export const requireTemplates = function requireTemplates(store) {

// Initialize templates, js, css and HMR acceptance logic
const prepend = `
let store = require('./huron-store.js');
const assets = require.context(${requirePath}, true, ${requireRegex});
const modules = {};
var store = require('./huron-store.js');
var assets = require.context(${requirePath}, true, ${requireRegex});
var modules = {};
assets.keys().forEach(function(key) {
modules[key] = assets(key);
Expand All @@ -37,12 +40,12 @@ if (module.hot) {
module.hot.accept(
assets.id,
() => {
const newAssets = require.context(
var newAssets = require.context(
${requirePath},
true,
${requireRegex}
);
const newModules = newAssets.keys()
var newModules = newAssets.keys()
.map((key) => {
return [key, newAssets(key)];
})
Expand Down
Loading

0 comments on commit 844c20f

Please sign in to comment.