-
-
Save MiKolka7/05780ab9d4a5f7fb3f448d40b2a6738f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const pathVuex = './node_modules/vuex/types/index.d.ts' | |
const pathVue = './node_modules/vuex/types/vue.d.ts' | |
function exitIfErr(err) { | |
if (err) { | |
process.exit(1) | |
} | |
} | |
fs.readFile(pathVuex, 'utf8', (err, data) => { | |
exitIfErr(err) | |
const res = data | |
.replace(/(\(type: string, payload\?: any, options\?)/g, '// $1') | |
.replace(/(<P extends Payload>\(payloadWithType: P)/g, '// $1') | |
fs.writeFile(pathVuex, res, exitIfErr) | |
}) | |
fs.readFile(pathVue, 'utf8', (err, data) => { | |
exitIfErr(err) | |
const res = data.replace(/(\$store: Store<any>;)/g, '// $1') | |
fs.writeFile(pathVue, res, exitIfErr) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "prjct", | |
"version": "1.0.0", | |
"scripts": { | |
"postinstall": "node ./fix-vendor.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment