将RequireJs改为AlmondsJs(Changing RequireJs to AlmondsJs)

编程入门 行业动态 更新时间:2024-10-12 22:29:21
RequireJs改为AlmondsJs(Changing RequireJs to AlmondsJs)

我有一个EmberJs应用程序和requireJs,在优化之后我想用AlmondJs替换requirejs库但是我总是得到这个错误

找不到模块车把。

有人知道它会是什么吗?

这是我的构建文件

({ appDir: "../", baseUrl: ".", dir: '../../www', modules: [ { name: "app/main" } ], inlineText: false, //removeCombined: true, preserveLicenseComments: false, insertRequire: ['app/main'], wrap:true, paths: { jquery: 'js/libs/jquery-1.9.1', jquerycookies: 'js/libs/jquery.cookie', //jqueryhotkeys: 'js/libs/jquery.hotkeys', // jquerytouchSwipe: 'js/libs/jquery.touchSwipe.min', // jqueryui: 'js/libs/jquery-ui.custom.min', // jqueryUiWidget: 'js/libs/jquery.ui.widget', //jqueryDropzone: 'js/libs/jquery.fileupload', jqueryJcrop: 'js/libs/jquery.Jcrop.min', highcharts: 'js/libs/highcharts', fastClick: 'js/libs/ember-fastclick', emberAnalytics: 'js/libs/ember-analytics', // fullCalendar: 'js/libs/fullcalendar.min', responsiveTables: 'js/libs/responsive-tables', lazyload: 'js/libs/jquery.lazyload.min', handlebars: 'js/libs/handlebars', ember: 'js/libs/ember', // ember_data: 'js/libs/ember-data.min', ember_animate: 'js/libs/ember-animated-outlet', // ember_I18n: 'js/libs/i18n', foundation: 'js/foundation/foundation', foundationReveal: 'js/foundation/foundation.reveal', foundationDropdown: 'js/foundation/foundation.dropdown', foundationForms: 'js/foundation/foundation.forms', foundationJoyride: 'js/libs/intro', // ckeditorcore: 'js/ckeditor/ckeditor', // ckeditorjquery: 'js/ckeditor/adapters/jquery', datePicker: 'js/plugins/jquery.simple-dtpicker' }, shim: { 'ember': { deps: ['jquery','handlebars'], exports: 'Ember' }, 'fastClick': { deps: ['ember'], exports: 'fastClick' }, 'emberAnalytics': { deps: ['ember'], exports: 'emberAnalytics' }, 'ember_animate': { deps: ['ember'], exports: 'Animate' }, 'jqueryJcrop': { deps: ['jquery'] }, 'jquerycookies': { deps: ['jquery'], exports: 'jQueryCookies' }, 'jqueryDropzone': { deps: ['jquery'], exports: 'jqueryDropzone' }, 'foundationJoyride': { exports: 'foundationJoyride' }, 'datePicker': { deps: ['jquery'], exports: 'datePicker' }, 'highcharts': { deps: ['jquery'], exports: 'highcharts' }, 'responsiveTables': { deps: ['jquery'], exports: 'responsiveTables' }, 'lazyload': { deps: ['jquery'], exports: 'lazyload' }, 'foundation': { deps: ['jquery'], exports: 'foundation' }, 'foundationReveal': { deps: ['jquery', 'foundation'], exports: 'foundation' }, 'foundationDropdown': { deps: ['jquery', 'foundation', 'foundationForms'], exports: 'foundation' }, 'foundationForms': { deps: ['jquery', 'foundation'], exports: 'foundation' } }, waitSeconds: 60 })

I have an EmberJs application along with requireJs, after optimisations I want to replace requirejs library with AlmondJs But I always get this error

Cannot find module handlebars.

Does anybody know what it could be?

Here is my build file

({ appDir: "../", baseUrl: ".", dir: '../../www', modules: [ { name: "app/main" } ], inlineText: false, //removeCombined: true, preserveLicenseComments: false, insertRequire: ['app/main'], wrap:true, paths: { jquery: 'js/libs/jquery-1.9.1', jquerycookies: 'js/libs/jquery.cookie', //jqueryhotkeys: 'js/libs/jquery.hotkeys', // jquerytouchSwipe: 'js/libs/jquery.touchSwipe.min', // jqueryui: 'js/libs/jquery-ui.custom.min', // jqueryUiWidget: 'js/libs/jquery.ui.widget', //jqueryDropzone: 'js/libs/jquery.fileupload', jqueryJcrop: 'js/libs/jquery.Jcrop.min', highcharts: 'js/libs/highcharts', fastClick: 'js/libs/ember-fastclick', emberAnalytics: 'js/libs/ember-analytics', // fullCalendar: 'js/libs/fullcalendar.min', responsiveTables: 'js/libs/responsive-tables', lazyload: 'js/libs/jquery.lazyload.min', handlebars: 'js/libs/handlebars', ember: 'js/libs/ember', // ember_data: 'js/libs/ember-data.min', ember_animate: 'js/libs/ember-animated-outlet', // ember_I18n: 'js/libs/i18n', foundation: 'js/foundation/foundation', foundationReveal: 'js/foundation/foundation.reveal', foundationDropdown: 'js/foundation/foundation.dropdown', foundationForms: 'js/foundation/foundation.forms', foundationJoyride: 'js/libs/intro', // ckeditorcore: 'js/ckeditor/ckeditor', // ckeditorjquery: 'js/ckeditor/adapters/jquery', datePicker: 'js/plugins/jquery.simple-dtpicker' }, shim: { 'ember': { deps: ['jquery','handlebars'], exports: 'Ember' }, 'fastClick': { deps: ['ember'], exports: 'fastClick' }, 'emberAnalytics': { deps: ['ember'], exports: 'emberAnalytics' }, 'ember_animate': { deps: ['ember'], exports: 'Animate' }, 'jqueryJcrop': { deps: ['jquery'] }, 'jquerycookies': { deps: ['jquery'], exports: 'jQueryCookies' }, 'jqueryDropzone': { deps: ['jquery'], exports: 'jqueryDropzone' }, 'foundationJoyride': { exports: 'foundationJoyride' }, 'datePicker': { deps: ['jquery'], exports: 'datePicker' }, 'highcharts': { deps: ['jquery'], exports: 'highcharts' }, 'responsiveTables': { deps: ['jquery'], exports: 'responsiveTables' }, 'lazyload': { deps: ['jquery'], exports: 'lazyload' }, 'foundation': { deps: ['jquery'], exports: 'foundation' }, 'foundationReveal': { deps: ['jquery', 'foundation'], exports: 'foundation' }, 'foundationDropdown': { deps: ['jquery', 'foundation', 'foundationForms'], exports: 'foundation' }, 'foundationForms': { deps: ['jquery', 'foundation'], exports: 'foundation' } }, waitSeconds: 60 })

最满意答案

将我的buid文件更改为

baseUrl: '../', name: 'js/libs/almond', include: ['app/main'], insertRequire: ['app/main'], out: '../../www/app/main.js', //wrap: true,

并删除wrap:true选项其工作probbaly

谢谢

after changing my buid file to

baseUrl: '../', name: 'js/libs/almond', include: ['app/main'], insertRequire: ['app/main'], out: '../../www/app/main.js', //wrap: true,

and removing wrap:true option its working probbaly

Thanks

更多推荐

本文发布于:2023-08-08 00:47:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466639.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:RequireJs   AlmondsJs   Changing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!