2.0.0 • Published 6 years ago

theme-webpack-plugin v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

About

This plugin allows you to use theme within any imported library that support it.

What is theme? Theme is just a directory inside module base directory that holds theme specific content (code, css, images, anything...)

Usage

Define module content

/my-cool-module
    /desktop
        index.js
    /mobile
        index.js
    index.js
    package.json

Add plugin to webpack resolver passing regex to match module name and theme name

const ThemeWebpackPlugin = require('theme-webpack-plugin');


resolver: {
    plugins: [
            new ThemeWebpackPlugin(/my-(cool|chill)-module/, 'desktop')
        ]
    };
}

Import module

import MyThemedClass from 'my-cool-module';

Now MyThemedClass is imported not from my-cool-module directory, but from my-cool-module/dekstop

2.0.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

7 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago