Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 4cdd94e

Browse files
committed
Merge branch 'next-preprocessor' into next
2 parents b39bd3c + 88da113 commit 4cdd94e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/index.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
8585

8686
return undefined
8787
},
88+
8889
load(id) {
8990
const query = parseVuePartRequest(id)
9091

@@ -192,6 +193,9 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
192193
source: block.content,
193194
scoped: block.scoped,
194195
modules: !!block.module,
196+
modulesOptions: options.cssModulesOptions,
197+
preprocessLang: block.lang as any,
198+
preprocessCustomRequire: options.preprocessCustomRequire,
195199
})
196200

197201
if (result.errors.length) {
@@ -477,8 +481,8 @@ function attrsToQuery(attrs: SFCBlock['attrs'], langFallback?: string): string {
477481
}`
478482
}
479483
}
480-
if (langFallback && !(`lang` in attrs)) {
481-
query += `&lang.${langFallback}`
484+
if (langFallback) {
485+
query += `lang` in attrs ? `.${langFallback}` : `&lang.${langFallback}`
482486
}
483487
return query
484488
}
@@ -522,6 +526,5 @@ function genCSSModulesCode(
522526
return code
523527
}
524528

525-
// overwrite TS generated exports for commonjs usage
526-
// but preserves typing
529+
// overwrite for cjs require('rollup-plugin-vue')() usage
527530
module.exports = PluginVue

0 commit comments

Comments
 (0)