diff --git a/README.md b/README.md index 0921706..dc37a44 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,6 @@ This plugin, unlike the original PurifyCSS plugin, provides special features, su | Property | Description |---------------------|------------ -| `styleExtensions` | An array of file extensions for determining used classes within style files. Defaults to `['.css']`. | `moduleExtensions` | An array of file extensions for determining used classes within `node_modules`. Defaults to `[]`, but `['.html']` can be useful here. | `minimize` | Enable CSS minification. Alias to `purifyOptions.minify`. Disabled by default. | `paths` | An array of absolute paths or a path to traverse. This also accepts an object (` -> `). It can be a good idea [glob](http://npmjs.org/glob) these. diff --git a/examples/webpack.config.js b/examples/webpack.config.js index aacb91d..1a3f199 100644 --- a/examples/webpack.config.js +++ b/examples/webpack.config.js @@ -25,8 +25,7 @@ module.exports = [ parts.purifyCSS({ verbose: true, minimize: true, - paths: glob.sync(`${PATHS.app}/*`), - styleExtensions: ['.css'] + paths: glob.sync(`${PATHS.app}/*`) }) ), merge( @@ -45,8 +44,7 @@ module.exports = [ paths: { first: glob.sync(`${PATHS.app}/*`), second: glob.sync(`${PATHS.another}/*`) - }, - styleExtensions: ['.css'] + } }) ) ]; diff --git a/src/index.js b/src/index.js index 3acdaaf..6808265 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,7 @@ module.exports = function PurifyPlugin(options) { compilation.chunks.forEach( ({ name: chunkName, files, modules }) => { const assetsToPurify = search.assets( - compilation.assets, options.styleExtensions + compilation.assets, ['.css'] ).filter( asset => files.indexOf(asset.name) >= 0 ); diff --git a/src/schema.js b/src/schema.js index cce104d..9a5778c 100644 --- a/src/schema.js +++ b/src/schema.js @@ -3,13 +3,6 @@ const schema = ({ entry } = {}) => ({ additionalProperties: false, type: 'object', properties: { - styleExtensions: { - type: 'array', - items: { - type: 'string' - }, - default: ['.css'] - }, minimize: { type: 'boolean' }, diff --git a/src/validate-options.test.js b/src/validate-options.test.js index fbae580..160da2b 100644 --- a/src/validate-options.test.js +++ b/src/validate-options.test.js @@ -33,18 +33,6 @@ describe('Validate options', function () { assert.ok(result.error); }); - it('styleExtensions have defaults', function () { - const paths = ['./foo']; - const data = { paths }; - - // Currently this mutates data with defaults due to ajv design. It - // might be a good idea to change that behavior, though. - const result = validateOptions(schema(), data); - - assert.deepEqual(data, { paths, styleExtensions: ['.css'] }); - assert.ok(!result.error); - }); - it('fails without matching path keys', function () { const data = { paths: {