nwb
nwb copied to clipboard
support for vendor prefixed nwb plugins
I wanted to add support for vendor prefixed plugins with the idea being that I can essentially create a plugin or I guess more accurately it would be a preset for my company. So for example, I would add @mycompany/nwb-react-component
to my dependencies which in turn would include the nwb-less
and ideally any other webpack config changes I use at my company. So the main entry for the @mycompany/nwb-react-component
would look something like this...
const merge = require('webpack-merge');
const lessPlugin = require('nwb-less');
const jsxPlugin = require('./jsx-plugin'); // TBD what this plugin would look like
module.exports = merge(lessPlugin, jsxPlugin);
Looking at the code it looks like the plugins currently have very limited effect on the build, so currently it looks like really I'll just be able to hook the nwb-less
plugin there and thats about it. So i'll be looking into making some changes there to support setting up other things. For example, at my company we'd prefer to use .jsx
file extensions, so we'll want to be able to add that to the list if extensions handled by the webpack babel plugin.
I've currently got this PR targeting master. I was gonna target next
(like the PR default comment mentions), but that looks like it hasn't been updated since june last year.