Skip to content

complexRequires and currentConfig problems with "prepend" #7

Closed
@Hadrien-DELAITRE

Description

@Hadrien-DELAITRE

Hello!

It seems to be buggy when i define "prepend" configuration like :

["css-modules-transform", { "prepend": ["postcss-cssnext"] }]

https://github.com/michalkvasnicak/babel-plugin-css-modules-transform/blob/master/src/index.js#L30

Maybe you have to clone currentConfig otherwise you will overwrite all values during the rest of the process.

When we log the value of currentConfig, we can see the following output for the first file:

{ generateScopedName: '[name]__[local]___[hash:base64:5]',
  prepend: [ 'postcss-cssnext' ] }

Then we can see the following output for the second file:

{ generateScopedName: '[name]__[local]___[hash:base64:5]',
  prepend:
   [ Processor {
       version: '5.0.14',
       plugins: [Object],
       postcssPlugin: 'postcss-cssnext',
       postcssVersion: '5.0.14' } ] }

Finally we got the throwing message :

Configuration 'prepend' has to be valid path to a module at index 0 or it does not export a function.

Its weird that "prepend" has been updated no ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions