Skip to content

Commit c15f876

Browse files
feat: accept module options
Resolves #21
1 parent ad5357b commit c15f876

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/module.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ const MODES = {
88
postcss: 'postcss'
99
}
1010

11-
export default function nuxtPurgeCss() {
12-
const { srcDir, purgeCSS = {} } = this.options
11+
export default function nuxtPurgeCss(moduleOptions) {
12+
const { srcDir, purgeCSS = {} } = Object.assign({}, this.options)
13+
14+
Object.assign(purgeCSS, moduleOptions)
1315

1416
logger.start('Loading module')
1517

test/fixture/configs/postcss/custom-options.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
resourceHints: false
99
},
1010
dev: false,
11-
modules: ['@@'],
11+
modules: [['@@', { mode: 'postcss' }]],
1212
build: {
1313
quiet: false,
1414
optimization: {
@@ -22,7 +22,6 @@ module.exports = {
2222
}
2323
},
2424
purgeCSS: {
25-
mode: 'postcss',
2625
paths: ['custom/**/*.vue'],
2726
styleExtensions: ['.css'],
2827
whitelist: ['whitelist'],

0 commit comments

Comments
 (0)