Questions tagged [requirejs-text]

45 questions
2
votes
1 answer

Symfony and RequireJS - How to serve static html files?

RequireJS text plugin (https://github.com/requirejs/text) needs files with .html extension. It seems that the .html requirement cannot be changed. My html files are located in the web folder of my Symfony project. With the default configuration it…
Xavier13
  • 771
  • 7
  • 16
2
votes
2 answers

Loading template images in requireJS module

I'm using the text plugin with requireJS in order to load some html into the page. I've defined a modules that is responsible for this: define(['jquery', 'text!/path/to/template/template_name.html'], function($, rciTpl){ Inside the module I have…
Radu
  • 1,044
  • 3
  • 12
  • 35
2
votes
0 answers

RequireJS text plugin - error when loading HTML template

I'm using RequireJS with the text plugin for my HTML-templates. define( [ 'text!./../../templates/twitterTemplate.html', 'jquery', 'underscore', 'backbone' ], function(twitterTemplate, $, _, Backbone) { var compiled =…
nekman
  • 1,919
  • 2
  • 15
  • 26
2
votes
1 answer

Requirejs Optimize project to single file

With a Build configuration as below, Why am i seeing all the files in source directory + minified application file when i run the deploy command specified below. I only need a single js file that will kickoff my backbone application Build Config ({ …
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178
2
votes
1 answer

In Require.js text plugin template, how should I provide javascript methods?

I'm using Require.js and the text plugin. I'm trying to create a template that has something like this: <%= somefunction(displayvalue) %> I need the somefunction(...) to be available to multiple templates. How is the best way to wrap the function…
ajma
  • 12,106
  • 12
  • 71
  • 90
2
votes
0 answers

How to point requireJS text plugin to an MVC action

I want to load HTML from an ASP.NET MVC 4 action. So full URL looks like: http://localhost:7588/en/Dialogs/AclManager Here is how I declare dependency: define(['jquery', 'text!AclManager'], function... Here is my require.config…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
1
vote
1 answer

Migrating RequireJS/AMD with Plugins to Webpack

I'm working on migrating a large RequireJS application to Webpack. The basic build with Webpack seems to work fine -- I've moved "paths" definitions to "alias" and I've setup loaders for my content and shims, like jQuery. However, there's a…
RoboBear
  • 5,434
  • 2
  • 33
  • 40
1
vote
0 answers

requirejs require("text!../path/to/text/file") equivalent for browserify

I have requirejs 3rd party modules that use requirejs and require text files using require("text!somefile.txt") How can I convert this to something browserify can read without any code change as its 3rd party library?
Encore PTL
  • 8,084
  • 10
  • 43
  • 78
1
vote
1 answer

Partial html localisation

The problem I need to localise my web application. I use two languages - english and norwegian (that should not matter). I use resource files to localise standard views. They sit in a separate project called…
Santhos
  • 3,348
  • 5
  • 30
  • 48
1
vote
0 answers

Testing Backbone with JSDOM

I'm trying to figure out how to test backbone using jsdom and nodeunit as the testing framework. I've got the error: "Error: Calling node's require("text") failed with error: Error: Cannot find module 'text'" What means, that the context was not…
gutomaia
  • 91
  • 1
  • 7
1
vote
1 answer

Error "Unable to get property 'normalize' of undefined or null reference" in require.js with text.js

I'm making my first attempt at using the text.js plugin (v2.0.12) for require.js (v2.1.15). I've had require working well up to this point, however, when I attempt to resolve a text dependency, I get two errors. The first error is Unable to get…
Vinney Kelly
  • 4,975
  • 1
  • 25
  • 31
1
vote
1 answer

RequireJS - custom paths and the text! plugin

I'm working on a SPA, and have optimized one of my code files with the requireJS optimizer, and set the new path like this: config.paths['billingmanager/billing/billing'] = 'billingmanager/billing/billing-build'; Unfortunately, code that now…
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
1
vote
1 answer

Is it possible to use object as invokable?

I found in requirejs-text plugin weird code. So load method accepts onLoad callable which is invoked for a few times as onLoad(), but later there is error handler which checks for an error method. if (onLoad.error) { onLoad.error(err); } Am i…
message
  • 4,513
  • 2
  • 28
  • 39
1
vote
0 answers

requirejs optimizer doesn't generate '.js' version of the text resource

In my project I use yeoman (1.0.6). In a fresh webapp copy installed requirejs-text plugin to include template.html. main.js require.config({ paths: { jquery: '../bower_components/jquery/jquery', text:…
simoncereska
  • 3,035
  • 17
  • 24
1
vote
1 answer

Requirejs:dist failed, Loader plugin did not call the load callback in the build: text

I'm using yeoman and grunt build fails at requirejs:dist with the error "Loader plugin did not call the load callback in the build: text". I've seen the question here but updating requirejs didn't help me. Console output below: PS D:\...> bower…
CamW
  • 3,223
  • 24
  • 34