core icon indicating copy to clipboard operation
core copied to clipboard

Webpack integration

Open Jand42 opened this issue 8 years ago • 0 comments

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.ts file 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/.fs file, or a .csproj/.fsproj and 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.

Jand42 avatar Oct 10 '17 20:10 Jand42