Skip to content

Commit df8a8d8

Browse files
committed
remove webpack option
1 parent 8adbf5e commit df8a8d8

File tree

4 files changed

+464
-557
lines changed

4 files changed

+464
-557
lines changed

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,19 @@ By default, the css standard plugin pack includes:
4444
Any of these plugins can be customized by passing the [options](#options) described below. You can also add additional postCSS plugins (like the popular [`lost`](https://github.com/peterramsing/lost) grid, for example) on top of this package:
4545

4646
```js
47-
// app.js
4847
const cssStandards = require('spike-css-standards')
4948
const lost = require('lost')
5049

51-
// ...
52-
postcss: (ctx) => {
53-
const css = cssStandards({ webpack: ctx })
54-
css.plugins.push(lost())
55-
return css
56-
},
57-
// ...
50+
const css = cssStandards()
51+
css.plugins.push(lost())
5852
```
5953

6054
### Options
6155

6256
| Name | Description | Default |
6357
| ---- | ----------- | ------- |
64-
| **root** | Root used to resolve `path`(s) from | If `webpack` option is provided, `options.context` |
65-
| **path** | A path to a folder or an array of paths, telling postcss-import where to look for sss or css files to `@import`. | If `webpack` option is provided, `loaderContext.resourcePath` |
66-
| **webpack** | Shortcut for webpack users to set the `root` and `path` options more easily. Pass webpack loader context. | |
58+
| **root** | Root used to resolve `path`(s) from | |
59+
| **path** | A path to a folder or an array of paths, telling postcss-import where to look for sss or css files to `@import`. | |
6760
| **browsers** | Browser support provided to [autoprefixer](http://cssnext.io/usage/#browsers) | `> 1%, last 2 versions, Firefox ESR` |
6861
| **features** | Enable or disable [cssnext features](http://cssnext.io/usage/#features) | |
6962
| **warnForDuplicates** | Enable or disable [cssnext duplicate warnings](http://cssnext.io/usage/#warnforduplicates) | `true` |

lib/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ module.exports = (options = {}) => {
99
if (options.parser === false) parser = undefined
1010
options.path = options.path ? Array.prototype.concat(options.path) : []
1111

12-
// define root/path defaults if the webpack object is provided
13-
if (options.webpack) {
14-
options.root = options.webpack.options.context
15-
options.path.push(options.webpack.resourcePath)
16-
}
17-
1812
// standard options merge
1913
const importOpt = selectiveMerge(options, ['root', 'path'])
2014
const cssnextOpt = selectiveMerge(options, ['browsers', 'features', 'warnForDuplicates'])

test/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ test('basic', (t) => {
88
t.truthy(opts.root === 'test')
99
t.truthy(opts.path[0] === 'test/test1')
1010
t.truthy(opts.path[1] === 'test/test2')
11-
t.truthy(opts.path[2] === 'test') // webpack.resourcePath
1211
})
1312

1413
cssStandardsRewired.__set__('cssnext', (opts) => {
@@ -23,15 +22,12 @@ test('basic', (t) => {
2322

2423
const out1 = cssStandardsRewired({
2524
parser: false,
26-
webpack: {
27-
resourcePath: 'test',
28-
options: { context: 'test' }
29-
},
3025
path: ['test/test1', 'test/test2'],
3126
features: 'test',
3227
browsers: 'test',
3328
warnForDuplicates: 'test',
34-
rucksack: 'test'
29+
rucksack: 'test',
30+
root: 'test'
3531
})
3632

3733
t.truthy(out1.plugins.length === 3)

0 commit comments

Comments
 (0)