aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

bundler uses different formatting for compared to `jspm install` #55

Closed atsu85 closed 8 years ago

atsu85 commented 8 years ago

Problem

bundler formats config.js differently compared to jspm install or update - git history is screwed. #54

Differences:

1) JSPM doesn't quote top-level keys in config. Result after jspm update

System.config({
  defaultJSExtensions: true,
  transpiler: "babel",
  babelOptions: {
    "optional": [
      "es7.decorators",
      "es7.classProperties"
    ]
  },

vs result after gulp bundle

System.config({
  "defaultJSExtensions": true,
  "transpiler": "babel",
  "babelOptions": {
    "optional": [
      "es7.decorators",
      "es7.classProperties"
    ]
  },

Suggestion

It would be nice if this format could be configured, so that git history would remain readable (without too much effort)

EisenbergEffect commented 8 years ago

@ahmedshuhel We should try to maintain the same formatting...

ahmedshuhel commented 8 years ago

@EisenbergEffect @atsu85 Ultimately, we are using JSON.stringify() to recreate the config file. I don't know if there is any way to tap into that function to change formatting. I will look into it. If that does not work we may have the change the whole implementation.

EisenbergEffect commented 8 years ago

@ahmedshuhel We should get in touch with @guybedford and ask why the serialization is that way. If he's using some 3rd party library to do that, we should use the same lib. But if that's somehow unintended, maybe we can all just use the standard stringify api.

ahmedshuhel commented 8 years ago

He is using something he wrote in jspm. I believe there is no third party library involved. I will raise an issue in jspm.

ahmedshuhel commented 8 years ago

Here is the issue I raised. https://github.com/jspm/jspm-cli/issues/1407

ahmedshuhel commented 8 years ago

The issue is fixed on the development branch. Will be included in the next release.