Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

CSS file not emitted when loaders defined with query string syntax #752

@james-s-turner

Description

@james-s-turner

I am trying to use multi-loader so that I can emit multiple CSS bundle files (one per theme). The multi loader only accepts query string style loader parameters. So I used the combine-loaders to stringify the output from ETWP. However when I do this the CSS bundle file is not emitted.
I have simplified my config - removing SASS and PostCSS etc leaving the following to isolate the issue

const extractTheme1 = new ExtractTextPlugin('theme1.css');
const extractLoader1 = extractTheme1.extract([
    {loader: 'css-loader'}
]);
const theme1Combined = combineLoaders(
    extractLoader1
);

module.exports = {
    entry: path.resolve('src/index.js'),
    output: {
        filename: "[name].js",
        path: path.resolve("dist")
    },
    module: {
        //rules: [{ test: /\.css$/, loader: theme1Combined}]  // LINE XXX
        rules: [{ test: /\.css$/, loader: extractLoader1}]   // LINE YYY
    },
    plugins: [
        extractTheme1
    ]
};

When I run the code as shown - the output of ETWP is use directly, everything is OK and the CSS bundle is written to /dist/theme1.css
When I run combineLoaders on the output of the extract() function ( uncommenting line XXX and removing line YYY) then the CSS bundle file is no longer written.
For fully working project see the repo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions