synapse-wireless-labs / component-lab

A component development and testing tool built for Angular, inspired by React Storybook.
79 stars 16 forks source link

Sample webpack config #11

Closed isaacplmann closed 7 years ago

isaacplmann commented 7 years ago

Can you post a sample webpack config just to get this running with an angular cli app? I'd like to get this running, but it's not worth writing a whole webpack config just for the component lab.

isaacplmann commented 7 years ago

Here's what I ended up doing.

In component-lab.config.js:

const NgCliWebpackConfig = require('@angular/cli/models/webpack-config').NgCliWebpackConfig;

module.exports = {
  /**
   * Webpack configuration object used to load your experiments
   */
  webpackConfig: new NgCliWebpackConfig({
    target: 'development',
  }).config,
  ...
}

And in the lab modules, make sure to import polyfills.ts:

import 'path/to/polyfills.ts';

This might be helpful to add to the README.md. I'll leave this open so you can decide if you want to add this to the readme.

brandonroberts commented 7 years ago

Fixed via #24