• Version 17.1.0
  • Published
  • 63.4 kB
  • 32 dependencies
  • MIT license


npm i webpack-atoms
yarn add webpack-atoms
pnpm add webpack-atoms


Small atomic bits for crafting webpack configs



function createAtoms

createAtoms: (options?: WebpackAtomsOptions) => WebpackAtoms;


    interface AstroTurfOptions

    interface AstroTurfOptions {}

      property allowGlobal

      allowGlobal?: boolean;

        property enableCssProp

        enableCssProp?: boolean;

          property extension

          extension?: string;

            property styleTag

            styleTag?: string;

              property tagName

              tagName?: string;

                property useAltLoader

                useAltLoader?: boolean;

                  method getFileName

                  getFileName: (path: string, opts: AstroTurfOptions, id: string) => string;

                    Type Aliases

                    type AstroturfRuleFactory

                    type AstroturfRuleFactory = RuleFactory<AstroTurfOptions> & {
                    sass: RuleFactory<AstroTurfOptions>;
                    less: RuleFactory<AstroTurfOptions>;

                      type ContextualRuleFactory

                      type ContextualRuleFactory<T = {}> = RuleFactory<T> & {
                      internal: RuleFactory<T>;
                      external: RuleFactory<T>;

                        type Env

                        type Env = 'production' | 'test' | 'development';

                          type LoaderAtoms

                          type LoaderAtoms = {
                          json: LoaderResolver<any>;
                          yaml: LoaderResolver<any>;
                          null: LoaderResolver<any>;
                          raw: LoaderResolver<any>;
                          style: LoaderResolver<any>;
                          css: LoaderResolver<any>;
                          miniCssExtract: LoaderResolver<
                          disable?: boolean;
                          fallback?: RuleSetUseItem;
                          } & MiniCssExtractPlugin.PluginOptions
                          astroturf: LoaderResolver<any>;
                          postcss: LoaderResolver<{
                          browsers?: string[];
                          | Record<string, any>
                          | ((...args: any[]) => Record<string, any>);
                          less: LoaderResolver<any>;
                          sass: LoaderResolver<any>;
                          file: LoaderResolver<any>;
                          url: LoaderResolver<any>;
                          js: LoaderResolver<any>;
                          imports: LoaderResolver<any>;
                          exports: LoaderResolver<any>;

                            type LoaderResolver

                            type LoaderResolver<T extends {}> = (options?: T) => RuleSetUseItem;

                              type PluginAtoms

                              type PluginAtoms = BuiltinPlugins & {
                              define: PluginFactory;
                              extractCss: PluginFactory;
                              html: PluginFactory;
                              loaderOptions: PluginFactory;
                              moment: PluginFactory;
                              minifyJs: PluginFactory;
                              minifyCss: PluginFactory;
                              unusedFiles: PluginFactory;
                              favicons: PluginFactory;
                              copy: PluginFactory;

                                type RuleAtoms

                                type RuleAtoms = {
                                js: JsRule;
                                yaml: RuleFactory<any>;
                                fonts: RuleFactory<any>;
                                images: RuleFactory<any>;
                                audioVideo: RuleFactory<any>;
                                files: RuleFactory<any>;
                                css: ContextualRuleFactory;
                                postcss: ContextualRuleFactory;
                                less: ContextualRuleFactory;
                                sass: ContextualRuleFactory;
                                astroturf: AstroturfRuleFactory;

                                  type RuleFactory

                                  type RuleFactory<T extends {} = {}> = (options?: T) => Rule;

                                    type WebpackAtoms

                                    type WebpackAtoms = {
                                    loaders: LoaderAtoms;
                                    rules: RuleAtoms;
                                    plugins: PluginAtoms;
                                    stats: StatAtoms;
                                    makeExternalOnly: (original: RuleFactory<any>) => RuleFactory<any>;
                                    makeInternalOnly: (original: RuleFactory<any>) => RuleFactory<any>;
                                    makeExtractLoaders: (
                                    options: { extract?: boolean },
                                    config: { fallback: RuleSetUseItem; use: RuleSetUseItem[] }
                                    ) => RuleSetUseItem[];

                                      type WebpackAtomsOptions

                                      type WebpackAtomsOptions = {
                                      babelConfig?: {};
                                      browsers?: string[];
                                      vendorRegex?: RegExp;
                                      env?: Env | null;
                                      assetRelativeRoot?: string;
                                      disableMiniExtractInDev?: boolean;
                                      ignoreBrowserslistConfig?: boolean;

                                        Package Files (1)

                                        Dependencies (32)

                                        Dev Dependencies (17)

                                        Peer Dependencies (1)


                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/webpack-atoms.

                                        • Markdown
                                        • HTML
                                          <a href="https://www.jsdocs.io/package/webpack-atoms"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>