requirejs / almond

A minimal AMD API implementation for use after optimized builds
Other
2.42k stars 169 forks source link

Uncaught Error: No fs #110

Open cocheok opened 8 years ago

cocheok commented 8 years ago

When I import my project as a AMD object it says. "Uncaught Error: No fs" And i don't use fs in my project.

cocheok commented 8 years ago

Gruntfile.js

requirejs: { compile: { options: { baseUrl : "src", include : ['myProject'], name : '../bower_components/almond/almond', wrap : { startFile: 'config/start.frag', endFile : 'config/end.frag' }, skipModuleInsertion: false, mainConfigFile : "require-config.js", out : "dist/myProject.js", // output file optimize : 'none' // optimise js code } } } start.frag // Details: https://github.com/jrburke/almond#exporting-a-public-api (function (root, factory) { if (typeof define === 'function' && define.amd) { //Allow using this built library as an AMD module //in another project. That other project will only //see this AMD call, not the internal modules in //the closure below. define([], factory); } else { //Browser globals case. Just assign the //result to a property on the global. root.MyProject = factory(); } }(this, function () {

end.frag

//The modules for your project will be inlined above
//this snippet. Ask almond to synchronously require the
//module value for 'main' here and return it as the
//value to use for the public API for the built file.
return requirejs('myProject');

}));

As no AMD it works fine but the problem is when I use as an AMD object.

ooxi commented 8 years ago

Please provide the full error message including stack trace. Also consider formatting your code using Markdown it's really simple but necessary to read your input :)