systemjs-builder: Angular 2 Component Relative Paths cause 404 errors

后端 未结 1 1286
北海茫月
北海茫月 2020-12-21 14:36

This is a cross post to https://github.com/systemjs/builder/issues/611

I\'m trying to bundle my Angular 2 rc 1 app with systemjs-builder 0.15.16 buildStatic

相关标签:
1条回答
  • 2020-12-21 15:27

    After a couple of days I got a helpful response from a systemjs member on github.

    What did the trick: in the configuration object for systemjs-builder's buildStatic method, set encodeNames to false. So the line...

    .buildStatic(
        appProd + '/main.js', 
        appProd + '/bundle.js', 
        { minify: false, sourceMaps: true}
    )
    

    became...

    .buildStatic(
        appProd + '/main.js', 
        appProd + '/bundle.js', 
        { minify: false, sourceMaps: true, encodeNames:false}
    )
    

    Additional Info

    tsconfig.json

    {
      "compilerOptions": {
        "target": "ES5",
        "module": "commonjs",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "outDir": "./app"
      },
      "filesGlob": [
        "./dev/**/*.ts",
        "!./node_modules/**/*.ts"
      ],
      "exclude": [
        "node_modules",
        "typings"
      ]
    }
    
    0 讨论(0)
提交回复
热议问题