dojo / themes

Dojo Framework Themes
11 stars 19 forks source link

Distribute raw and built files together #23

Closed mwistrand closed 6 years ago

mwistrand commented 6 years ago

Type: feature

The following has been addressed in the PR:

Description:

When building for release, provide bundled index.js and index.css files that can be used as-is for themes. This allows individual modules to be used in composition (e.g., composes: root from '@dojo/themes/dojo/button.m.css) and also allows the entire theme to be imported as a single, pre-built module. Since @dojo/cli-build-app (and soon @dojo/cli-build-widget) will no longer reach up into node_modules, applications must now import themes they need into both widget modules and src/main.css.

Use @dojo/scripts for the release command.

Resolves #22

mwistrand commented 6 years ago

With these changes, the build becomes a multi-step process:

  1. Generate .d.ts files for the CSS files
  2. Run the TypeScript compiler to get the main index.d.ts
  3. Pass the CSS modules through PostCSS and bundle them together with webpack

Step 2 is a bit of a hack since the webpack build overwrites the index.js created by tsc, but of the many approaches I tried this was the only one that allowed for a simple d.ts at the same level as the compiled index.js.

mwistrand commented 6 years ago

@matt-gadd I split out the custom element build, so now:

matt-gadd commented 6 years ago

@mwistrand that sounds perfect to me 😄