rollup-plugin-vue
Advanced tools
Comparing version 6.0.0-beta.8 to 6.0.0-beta.9
@@ -136,2 +136,29 @@ "use strict"; | ||
const block = descriptor.styles[query.index]; | ||
let preprocessOptions = options.preprocessOptions || {}; | ||
const preprocessLang = (options.preprocessStyles | ||
? block.lang | ||
: undefined); | ||
if (preprocessLang) { | ||
preprocessOptions = | ||
preprocessOptions[preprocessLang] || preprocessOptions; | ||
// include node_modules for imports by default | ||
switch (preprocessLang) { | ||
case 'scss': | ||
case 'sass': | ||
preprocessOptions = { | ||
includePaths: ['node_modules'], | ||
...preprocessOptions, | ||
}; | ||
break; | ||
case 'less': | ||
case 'stylus': | ||
preprocessOptions = { | ||
paths: ['node_modules'], | ||
...preprocessOptions, | ||
}; | ||
} | ||
} | ||
else { | ||
preprocessOptions = {}; | ||
} | ||
const result = await compiler_sfc_1.compileStyleAsync({ | ||
@@ -147,7 +174,5 @@ filename: query.filename, | ||
modulesOptions: options.cssModulesOptions, | ||
preprocessLang: options.preprocessStyles | ||
? block.lang | ||
: undefined, | ||
preprocessLang, | ||
preprocessCustomRequire: options.preprocessCustomRequire, | ||
preprocessOptions: options.preprocessOptions || {}, | ||
preprocessOptions, | ||
}); | ||
@@ -247,3 +272,3 @@ if (result.errors.length) { | ||
cache.set(id, descriptor); | ||
return { descriptor, errors }; | ||
return { descriptor, errors: errors }; | ||
} | ||
@@ -362,17 +387,27 @@ function transformVueSFC(code, resourcePath, descriptor, { rootContext, isProduction, isServer, filterCustomBlock, }, options) { | ||
function createRollupError(id, error) { | ||
return { | ||
id, | ||
plugin: 'vue', | ||
pluginCode: String(error.code), | ||
message: error.message, | ||
frame: error.loc.source, | ||
parserError: error, | ||
loc: error.loc | ||
? { | ||
file: id, | ||
line: error.loc.start.line, | ||
column: error.loc.start.column, | ||
} | ||
: undefined, | ||
}; | ||
if ('code' in error) { | ||
return { | ||
id, | ||
plugin: 'vue', | ||
pluginCode: String(error.code), | ||
message: error.message, | ||
frame: error.loc.source, | ||
parserError: error, | ||
loc: error.loc | ||
? { | ||
file: id, | ||
line: error.loc.start.line, | ||
column: error.loc.start.column, | ||
} | ||
: undefined, | ||
}; | ||
} | ||
else { | ||
return { | ||
id, | ||
plugin: 'vue', | ||
message: error.message, | ||
parserError: error, | ||
}; | ||
} | ||
} | ||
@@ -379,0 +414,0 @@ // these are built-in query parameters so should be ignored |
{ | ||
"name": "rollup-plugin-vue", | ||
"version": "6.0.0-beta.8", | ||
"version": "6.0.0-beta.9", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26806
7
579