core
core copied to clipboard
Webpack integration
Currently on ts-output branch, WebSharper packager has an option to output a TypeScript module for a project that has:
import "https://code.jquery.com/jquery-3.1.1.min.js" // for outside JS resources
import * as WSM from "./WebSharper.Main"; // for other WebSharper TS modules
-
[ ] CSS resources are currently not included as RequireJS can't handle them, but webpack can, so WS needs a compiler option to generate a
.d.tsfile for these as is described at https://webpack.js.org/guides/typescript/#importing-other-assets -
[ ] Create a loader for webpack that can take a
wsconfig.json(see #798), a single.cs/.fsfile, or a.csproj/.fsprojand run WebSharper compilation with a default configuration or reading it from the webpack config object.
The WS loader outputs .ts, so the TS loader can pick it up as is usual for loader chaining.