mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-06-17 03:34:58 -04:00
feat: externalized tool configuration
This commit is contained in:
parent
c3adfe30ec
commit
690bd099ef
31 changed files with 387 additions and 300 deletions
13
buildModules/tool-config/loader.js
Normal file
13
buildModules/tool-config/loader.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const YAML = require('yaml')
|
||||
|
||||
const loader = function (source, map) {
|
||||
this.callback(
|
||||
null,
|
||||
`export default function (Component) {
|
||||
Component.options.__toolConfig = ${JSON.stringify(YAML.parse(source))}
|
||||
}`,
|
||||
map
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = loader
|
Loading…
Add table
Add a link
Reference in a new issue