philcockfield / ui-harness

Create, isolate and test modular UI components in React.
http://uiharness.com
MIT License
268 stars 14 forks source link

Reusing config from my own `webpack.config.js` #90

Open klavs opened 8 years ago

klavs commented 8 years ago

I've set up my build process described in Smarter CSS builds with Webpack. You can take this repo as an example. The only difference to my setup is that I am using scss syntax and .scss extension instead of .sass

The main idea is that my styles are built only if they are actually used. If I use this kind of component in my spec.js, UIHarness complains that it does not understand .scss and a loader is probably needed. As you can see in the example repo, I have my loaders already defined in webpack.config.js so I am unwilling to add them to import or require statement.

Is there any chance that I could configure UIHarness to work with my components?

philcockfield commented 8 years ago

Yeah, it would be good to either completely swap out the webpack config, or perhaps merge it in to whatever the UIHarness needs to run.

klavs commented 8 years ago

For now, I forked ui-harness and added a possibility to define my own loaders in .yml. Not perfect, though. One of my loaders has autoprefixer configuration as an object in webpack.config.js. Moving that object to .yml would be a pain.

entry: ./specs
port: 3030

loaders:
  - test: \.scss$
    loader: style!css-loader!postcss-loader!sass-loader
Youpinadi commented 8 years ago

I have the same issue trying to load less files in my components, it would be great to be able to handle this case.