mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Display warning message only once
This commit is contained in:
parent
b9ba532df8
commit
824885ed0a
@ -19,6 +19,12 @@ module.exports = hexo => {
|
|||||||
if (typeof internal === 'function') {
|
if (typeof internal === 'function') {
|
||||||
internal(hexo, dependencies);
|
internal(hexo, dependencies);
|
||||||
}
|
}
|
||||||
|
let { plugins = 'cdnjs' } = vendors;
|
||||||
|
if (plugins === 'local' && typeof internal === 'undefined') {
|
||||||
|
hexo.log.warn('Dependencies for `plugins: local` not found. The default CDN provider CDNJS is used instead.');
|
||||||
|
hexo.log.warn('Run `npm install @next-theme/plugins` in Hexo site root directory to install the plugin.');
|
||||||
|
plugins = 'cdnjs';
|
||||||
|
}
|
||||||
for (const [key, value] of Object.entries(dependencies)) {
|
for (const [key, value] of Object.entries(dependencies)) {
|
||||||
// This script will be executed repeatedly when Hexo listens file changes
|
// This script will be executed repeatedly when Hexo listens file changes
|
||||||
// But the variable vendors[key] only needs to be modified once
|
// But the variable vendors[key] only needs to be modified once
|
||||||
@ -41,12 +47,6 @@ module.exports = hexo => {
|
|||||||
local : url_for.call(hexo, `lib/${name}/${file}`),
|
local : url_for.call(hexo, `lib/${name}/${file}`),
|
||||||
custom : vendors.custom_cdn_url
|
custom : vendors.custom_cdn_url
|
||||||
});
|
});
|
||||||
let { plugins = 'cdnjs' } = vendors;
|
|
||||||
if (plugins === 'local' && typeof internal === 'undefined') {
|
|
||||||
hexo.log.warn('Dependencies for `plugins: local` not found. The default CDN provider CDNJS is used instead.');
|
|
||||||
hexo.log.warn('Run `npm install @next-theme/plugins` in Hexo site root directory to install the plugin.');
|
|
||||||
plugins = 'cdnjs';
|
|
||||||
}
|
|
||||||
vendors[key] = {
|
vendors[key] = {
|
||||||
url : links[plugins] || links.cdnjs,
|
url : links[plugins] || links.cdnjs,
|
||||||
integrity: value.integrity
|
integrity: value.integrity
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user