feat: doc 使用最新cdn version
This commit is contained in:
parent
c578a64161
commit
e59f150647
13
helper/mod-index-html-version.js
Normal file
13
helper/mod-index-html-version.js
Normal file
@ -0,0 +1,13 @@
|
||||
const pkg = require('../package.json');
|
||||
const util = require('./util');
|
||||
|
||||
function modIndexHtmlVersion () {
|
||||
util.read('index.html', (html) => {
|
||||
let res = html.match(new RegExp(`https://cdn.jsdelivr.net/npm/disable-devtool@.*/disable-devtool.min.js#use`));
|
||||
if (res) {
|
||||
util.write('index.html', html.replace(res[0], `https://cdn.jsdelivr.net/npm/disable-devtool@${pkg.version}/disable-devtool.min.js#use`));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
modIndexHtmlVersion();
|
@ -178,7 +178,7 @@ disableDevtool(options);</code></p>
|
||||
<script
|
||||
disable-devtool-auto
|
||||
md5='1aabac6d068eef6a7bad3fdf50a05cc8'
|
||||
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
||||
src='https://cdn.jsdelivr.net/npm/disable-devtool@0.1.0/disable-devtool.min.js#use'
|
||||
url='https://github.com/theajack/disable-devtool'
|
||||
></script>
|
||||
<!-- <script disable-devtool-auto md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='./npm/disable-devtool.min.js'></script> -->
|
||||
|
@ -15,7 +15,8 @@
|
||||
"start": "npm run dev",
|
||||
"build": "webpack --config webpack-config/build.js",
|
||||
"publish": "npm publish npm",
|
||||
"lint": "eslint src --ext js"
|
||||
"lint": "eslint src --ext js",
|
||||
"sync-version": "node helper/mod-index-html-version.js"
|
||||
},
|
||||
"author": "theajack",
|
||||
"repository": {
|
||||
|
@ -1,6 +1,7 @@
|
||||
const path = require('path');
|
||||
require('../helper/copy-to-npm');
|
||||
require('../helper/copy-version');
|
||||
require('../helper/mod-index-html-version');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
|
Loading…
x
Reference in New Issue
Block a user