Reputation: 35223
I'm using Grunt to build the Durandal starter kit pro package.
It all works fine, except for one tiny detail. I would like to exclude one file (app-config
below) from the optimizer and keep it as a non minified file when my build is done.
Based on other SO thread suggestions, I'm currently excluding it using empty:
, which removes it from the optimized file as expected. However, when I open the built project I get an error in the console:
Uncaught Error: main missing app-config
options: {
name: '../lib/require/almond-custom',
baseUrl: requireConfig.baseUrl,
mainPath: 'app/main',
paths: mixIn({ }, requireConfig.paths, {
'almond': 'lib/require/almond-custom',
'app-config': 'empty:'
}),
optimize: 'none',
out: 'build/app/main.js',
preserveLicenseComments: false
}
Is almond the problem? I tried switching it to the full requirejs using include: ['path/to/require']
, without success.
If you want to reproduce it locally you can either download the starter kit from the above link, or use a slightly configurated version which is closer to my example. Just run an npm install
in the folder and you're all set.
Upvotes: 6
Views: 213
Reputation: 56557
try:
....
paths: mixIn({ }, requireConfig.paths, {
'almond': ['lib/require/almond-custom', '!lib/require/almond-custom/app-config.js']
}),
....
just note the second path of app-config.js
is correct. I think you should find your way, the above is a hint, if not a direct solution.
Upvotes: 0
Reputation: 22209
From the reference of the durandal
issues found in this particular link
grunt-durandal
The main module controls the implementation of the durandal services
The link can be found in main.js
Here you can see the system.debug(true).You can remove it as written in the post here document.
The function as quoted in the article Overrides request execution timeout making it effectively infinite
.
Also while using uglify in grunt the debug is set to false as per the documentation.
As per the documentation you need to set the system.debug(false)
Hope this might help a bit.
Upvotes: 0
Reputation: 20034
I have downloaded you source code and do the following steps.
cmd
and change the directory to this folder.npm install
to install all the dependencies.grunt
to start to build the project.And when I open http://localhost:8999/ and saw the alert 1
which is alert(appConfig.foo);
in your main.js
.
After clicked Ok
to hide the alert, the web page works fines. Any more input for you ?
So I am not sure how you are facing with this issue.
Upvotes: 3