fable-compiler / samples-pixi

Pixi samples for Fable
http://fable.io/samples-pixi/
Apache License 2.0
17 stars 4 forks source link

Feature/improve deps reference #20

Closed MangelMaxime closed 7 years ago

MangelMaxime commented 7 years ago

This PR use webpack to include dependencies: For example for:

  "basic": {
    "entry": "PixiBasic.fsproj",
    "dependencies": [
      "pixi.js"
    ],
    "title": "Pixi sample",
    "desc": "Simple renderization with [PixiJS](http://www.pixijs.com/), a fast and flexible library to render 2D WebGL content.",
    "img": "pixi.jpeg"
  }

We generate:

entry : {
  basic: [
    "pixi.js",
    "PixiBasic.fsproj"
  ]
}

"pixi.js" will be include from the node_modules.

I will work on it tomorrow again to not generate the source-map on production mode and see we can mutualise dependencies between the samples to avoid including pixi.js in each bundle.js files.

Edit: Big advantage of this PR, we can update the dependencies in one time just by updating the package.json and regenerating the samples.

alfonsogarciacaro commented 7 years ago

This is a great idea @MangelMaxime! Thank you :clap: :clap:

MangelMaxime commented 7 years ago

@whitetigle @alfonsogarciacaro

If one of you can test this PR and merge it if you agree with the change would be awesome :)

I am more works planned, for the generation of index.html but would be part of the update of the fable docs site. (make them more easier for newcomers, better demo/showcase, etc.)

whitetigle commented 7 years ago

Ok so it's working on my side. However, does it mean this:

    <Compile Include="..\Fable.Import.Pixi.fs" />
    <Compile Include="App.fs" />

can become:

    <Compile Include="App.fs" />
MangelMaxime commented 7 years ago

@whitetigle 100% right. I always forget to clean the fsproj after cleaning files has Ionide doesn't complain about it.