Dominictus
Dominictus

Reputation: 721

Durandal optimizer creates syntax error in app.build.js

As I'm trying to publish my app, there is an "app.build.js" file generated which looks like this:

{
  "name": "durandal/amd/almond-custom",
  "inlineText": true,
  "stubModules": [
    "durandal/amd/text"
  ],
  "paths": {
    "text": "durandal/amd/text"
  },
  "include": [
    "config",
    "main-built",
    "main",

and so forth. I get bunch of syntax errors in this file when trying to build the project. How can I define optimizer to generate file with no syntax errors?

Final error I get is when whole project is published, main-built.js generates "ko is not defined" error.

Thanks!

Upvotes: 0

Views: 304

Answers (1)

Dominictus
Dominictus

Reputation: 721

Okay, that was completely my bad, this file is working as intended even tho Resharper shows tons of errors.

I thought it was the reason my main-built.js was showing "ko is not defined" when whole project was published.

For everyone else, when building a release version, make sure your BundleConfig.cs contains non-debug versions of libraries you use. My Bundle contained only knockout-{version}.debug.js. The solution was to just add non-debug version and it all works as intended now!

Upvotes: 1

Related Questions