grunt-contrib-requirejs

'no such file' error when using grunt-requirejs compile

て烟熏妆下的殇ゞ 提交于 2020-01-05 12:23:32
问题 Since most issues with require.js build has to do with file structure and relative path reference, I created a repo here: https://github.com/ttback/requirejs-example for easier troubleshoot. The error is when i run grunt, I will get no such file or directory requirejs-example/src/js/bundle/js/bundle/utils.js This is due to the wrong baseUrl. I want it to be src/ but I can't set it since it goes to find the dependencies for src/js/bundle/main.js based on my Gruntfile. So the base is at src/js

RequireJS Optimization

微笑、不失礼 提交于 2020-01-02 20:29:10
问题 I`m using r.js to optimize my app, as i saw in several samples, i used build.json configuration file to config my optimization options. The problem is that when i set reference to the output javascript file after optimization I`m getting the following error in the browser: Uncaught ReferenceError: define is not defined main-built.js:14735 Looks like, all my app modules are exists but RequireJs is missing. This is my build.json configuration file: { "baseUrl": "../", "name": "src/modules/main"

Combining files using requirejs and grunt

好久不见. 提交于 2019-12-14 03:44:41
问题 I am trying to combine files using the grunt plugin for requirejs: https://www.npmjs.org/package/grunt-contrib-requirejs Here is the configuration: requirejs: compile: options: #appDir: './' baseUrl: "client" mainConfigFile: "client/test1.js" name: "test1" out: "build/test.js" onModuleBundleComplete: (data) -> outputFile = data.path fs.writeFileSync(outputFile, amdclean.clean( 'filePath': outputFile )) wrap: start: "" end: "" Here are the input and output javascript Input: test1.js var x =

Shim from grunt-contrib-requirejs not wrapping library

混江龙づ霸主 提交于 2019-12-07 05:54:09
问题 I am using requirejs and configuring my product artifacts, thus combining my libraries and setting up module dependencies between them to get the loading sequence appropriate using the grunt task for requirejs. I have no problem using runtime module injection while in my livereload server which has access to non-combined libraries. For the sake of clarity I have disabled all minification/uglification and turned on a js-beautify. requirejs: { dist: { // Options: https://github.com/jrburke/r.js

grunt requirejs ignores paths from my mainConfigFile

谁说胖子不能爱 提交于 2019-12-07 01:13:57
问题 Project Intro My project is a single page storefront. The project has multiple modules, and each module contains a set of controller.js, view.js and model.js files, as well as a template.html file. And uses requirejs to manage dependencies. Problem Statement I want to use mainConfigFile to provide paths to reference modules in grunt-requirejs. Part of my mainConfigFile's require.config is stored in separate file (base.dependency.config), and require.config.paths are pieced together by

'define' is not defined error on RequireJS & Webapp Yo generator

北慕城南 提交于 2019-12-06 14:32:06
问题 I have struggled a few days to figure this out,, but finally I need your help today. my repo: https://github.com/seoyoochan/bitsnut-web what I want to achieve : - Load and optimize r.js - Write bower tasks for RequireJS and r.js : tasks are: minify & uglify & concatenation for RequireJS, and optimise with r.js on production - How to exclude js script tags in index.html when using wiredep tasks and load them through RequireJS loader? I use Yeoman 'Webapp' generator and generated the scaffold

Shim from grunt-contrib-requirejs not wrapping library

蹲街弑〆低调 提交于 2019-12-05 10:01:37
I am using requirejs and configuring my product artifacts, thus combining my libraries and setting up module dependencies between them to get the loading sequence appropriate using the grunt task for requirejs. I have no problem using runtime module injection while in my livereload server which has access to non-combined libraries. For the sake of clarity I have disabled all minification/uglification and turned on a js-beautify. requirejs: { dist: { // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js options: { // `name` and `out` is set by grunt-usemin // name: 'App

grunt requirejs ignores paths from my mainConfigFile

跟風遠走 提交于 2019-12-05 05:45:48
Project Intro My project is a single page storefront. The project has multiple modules, and each module contains a set of controller.js, view.js and model.js files, as well as a template.html file. And uses requirejs to manage dependencies. Problem Statement I want to use mainConfigFile to provide paths to reference modules in grunt-requirejs. Part of my mainConfigFile's require.config is stored in separate file (base.dependency.config), and require.config.paths are pieced together by underscore at runtime. base.dependency.config config = { baseDependencyConfig: { paths: { ... } shim: { ... }

'define' is not defined error on RequireJS & Webapp Yo generator

核能气质少年 提交于 2019-12-04 19:44:39
I have struggled a few days to figure this out,, but finally I need your help today. my repo: https://github.com/seoyoochan/bitsnut-web what I want to achieve : - Load and optimize r.js - Write bower tasks for RequireJS and r.js : tasks are: minify & uglify & concatenation for RequireJS, and optimise with r.js on production - How to exclude js script tags in index.html when using wiredep tasks and load them through RequireJS loader? I use Yeoman 'Webapp' generator and generated the scaffold app. I installed backbone, marionette, text, underscore, and etc via bower install I modified bower.json