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

Move API to use/fallback in v2 #382

Closed
bebraw opened this issue Jan 31, 2017 · 2 comments
Closed

Move API to use/fallback in v2 #382

bebraw opened this issue Jan 31, 2017 · 2 comments

Comments

@bebraw
Copy link
Contributor

bebraw commented Jan 31, 2017

To comply with use, the API should look like this (to quote @sokra):

use: ETP.extract({
  fallback: [
    { loader: "style-loader", options: {} }
  ],
  use: [
    { loader: "css-loader" },
    { loader: "postcss-loader", options: { plugin() { ... } } }
  ]
})

We probably should give deprecation messages for the old fields.

@bebraw bebraw added this to the 2.0 final milestone Jan 31, 2017
@jaydenseric
Copy link

jaydenseric commented Feb 1, 2017

Should it not be loader: ETP.extract({?

When did fallbackLoader get replaced with a fallback array? The readme must need updating.

Also, just want to clarify mixing objects and strings in use arrays will be ok, like with webpack.

So you could do:

loader: ETP.extract({
  fallbackLoader: 'style-loader',
  use: [
    'css-loader',
    {
      loader: 'postcss-loader',
      options: { ... }
    }
  ]
})

Or if css-loader requires options:

loader: ETP.extract({
  fallbackLoader: 'style-loader',
  use: [
    {
      loader: 'css-loader',
      options: {
        importLoaders: 1
      }
    },
    {
      loader: 'postcss-loader',
      options: { ... }
    }
  ]
})

@bebraw
Copy link
Contributor Author

bebraw commented Feb 1, 2017

Hi,

This change hasn't been done yet. That's why the README isn't done yet.

The old loader: plugin.extract legacy syntax is still supported although use is preferred.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants