naive-ui/playground/naiveScssVarPlugin.js
2020-01-13 14:26:14 +08:00

18 lines
396 B
JavaScript

module.exports = function naiveSCSSExportVariable () {
return {
name: 'naive-scss-export-variable',
resolveId (source) {
if (source.endsWith('jsIndex.scss')) {
return 'naive-scss-js-index'
}
return null
},
load (id) {
if (id === 'naive-scss-js-index') {
return `export default 'naive-scss-js-index'`
}
return null
}
}
}