Unexpected token < SystemJS Production build

111 views Asked by At

I am using AngularJS writen in typescript and SystemJS module builder. My app's main file (app.ts) is located inside Scripts/App.

SytemJS production configuration from gulpfile.js:

gulp.task("deploy", ["ts", "vendorjs", "app-css"], function (done) {
return systemBuild("./Scripts/App/app", "./dist/js/main_" + build + ".min.js");
});

function systemBuild(sourcepath, targetPath, cb) {
var builder = new Builder();

// Collection bundling
builder.config({
    defaultJSExtensions: true,
    map: {
        "ts": "node_modules/plugin-typescript/lib/plugin.js"
    },
    baseURL: "./Scripts",
    transpiler: "ts",
    typescriptOptions: {
        module: "system",
        target: "es5",
        sourceMap: true,
        inlineSourceMap: true,
        inlineSources: true,
        resolveTypings: true,
        emitDecoratorMetadata: true,
        noImplicitAny: true,
        typeCheck: true,                // also accepts "strict"
        tsconfig: true               // also accepts a path
    },
    packages: {
        "app": {
            defaultExtension: "ts"
        }
    }
});

return builder.buildStatic(sourcepath, targetPath, {
    minify: true,
    mangle: true,
    sourceMaps: false,
    sourceMapContents: false,
    globalDefs: { DEBUG: false }
});
}

After running gulp default, I am getting 'Uncaught SyntaxError: Unexpected token <' error. Could anybody tell me what I am doing wrong?

0

There are 0 answers