SlexAxton / require-handlebars-plugin

A plugin for handlebars in require.js (both in dev and build)
804 stars 202 forks source link

./build.sh fails #228

Open mattkime opened 9 years ago

mattkime commented 9 years ago

if i checkout this project and run "./build.sh" i get the following error -

➜  require-handlebars-plugin git:(master) ./build.sh
Optimizing (standard) CSS file: /Users/mattk/code/require-handlebars-plugin/demo-build/styles/one.css
Optimizing (standard) CSS file: /Users/mattk/code/require-handlebars-plugin/demo-build/styles/two.css

Tracing dependencies for: main
Error: ENOENT, no such file or directory '/Users/mattk/code/require-handlebars-plugin/demo-build/template_coolPartial.hbs'
In module tree:
    main
      hbs

Error: Error: ENOENT, no such file or directory '/Users/mattk/code/require-handlebars-plugin/demo-build/template_coolPartial.hbs'
In module tree:
    main
      hbs

    at Object.fs.openSync (fs.js:427:18)

/Users/mattk/code/require-handlebars-plugin/demo-build/styles/screen.build.css
----------------
/Users/mattk/code/require-handlebars-plugin/demo-build/styles/screen.build.css

this is easily fixed by swapping changing demo/template/one.hbs

{{> template_coolPartial }}

to

{{> template/coolPartial }}

but this error remains

Optimizing (standard) CSS file: /Users/mattk/code/require-handlebars-plugin/demo-build/styles/one.css
Optimizing (standard) CSS file: /Users/mattk/code/require-handlebars-plugin/demo-build/styles/two.css

Tracing dependencies for: main
Error: ENOENT, no such file or directory '/Users/mattk/code/require-handlebars-plugin/demo-build/templates/helpers/yeller.js'
In module tree:
    main
      hbs

Error: Error: ENOENT, no such file or directory '/Users/mattk/code/require-handlebars-plugin/demo-build/templates/helpers/yeller.js'
In module tree:
    main
      hbs

    at Object.fs.openSync (fs.js:427:18)

/Users/mattk/code/require-handlebars-plugin/demo-build/styles/screen.build.css
----------------
/Users/mattk/code/require-handlebars-plugin/demo-build/styles/screen.build.css
plutrono commented 9 years ago

There are hard coded paths to templates instead of template. Next issue is that there's no Handlerbars.js at the top level, it's in hbs/handlebars.js (note case)

Now It's failing with an error about modules sharing the same URL. :(

Feeling like I need to skip this plugin and write my own.

Here are my diffs so far in case it's helpful:

git diff
diff --git a/demo/app.build.js b/demo/app.build.js
index c15295d..4aca922 100755
--- a/demo/app.build.js
+++ b/demo/app.build.js
@@ -20,7 +20,7 @@

     paths: {
       "hbs": "../hbs",
-      "Handlebars" : "../Handlebars",
+      "Handlebars" : "../hbs/handlebars",
       "underscore" : "../hbs/underscore",
       "i18nprecompile" : "../hbs/i18nprecompile",
       "json2" : "../hbs/json2"
diff --git a/demo/template/one.hbs b/demo/template/one.hbs
index 3cfcc72..57b1ae3 100755
--- a/demo/template/one.hbs
+++ b/demo/template/one.hbs
@@ -34,7 +34,7 @@
   {{/each}}
   <br />

-  {{> template_coolPartial }}
+  {{> template/coolPartial }}
   <br />
   i18n2: {{$ "key2"}}
 </div>
diff --git a/hbs.js b/hbs.js
index 3f6ae67..f83139d 100755
--- a/hbs.js
+++ b/hbs.js
@@ -31,8 +31,8 @@ define([
   var customNameExtension = '@hbs';
   var devStyleDirectory = '/styles/';
   var buildStyleDirectory = '/demo-build/styles/';
-  var helperDirectory = 'templates/helpers/';
-  var i18nDirectory = 'templates/i18n/';
+  var helperDirectory = 'template/helpers/';
+  var i18nDirectory = 'template/i18n/';
   var buildCSSFileName = 'screen.build.css';
   var onHbsReadMethod = "onHbsRead";
chrisrink commented 9 years ago

Should be fixed in 96188fa66fefe988c460888d69f379c31af552f7