wix-incubator / stylable-integration

Integrating Stylable into your project
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

preserve pre-defined css require hooks #34

Closed shlomitc closed 6 years ago

shlomitc commented 6 years ago

This PR handles the scenario of having an already defined css require extension hook which needs to be applied to .css files only. In such case, stylable's require-hook will preserve it and handle only .st.css files.

As require order matters, I wonder if there should be another entry point for this hook that doesn't invoke it immediately as a side affect.

how it should be applied now:

applySomeCSSHook();
require('stylable-integration/require');

how it can be applied if not invoked immediately:

const {attachHook} = require('stylable-integration/require-hook');

applySomeCSSHook();
attachHook({});

Let me know what you think.