💥 vendor folder to cdn

pull/4075/head
Daniel 3 years ago
parent 98fcdc484b
commit ca97a4a48d

@ -9,7 +9,6 @@ const eslint = require('gulp-eslint-new')
const fileinclude = require('gulp-file-include')
const validator = require('gulp-html')
const gulpIf = require('gulp-if')
const npmDist = require('gulp-npm-dist')
const postcss = require('gulp-postcss')
const rename = require('gulp-rename')
const sass = require('gulp-sass')(require('sass'))
@ -35,8 +34,7 @@ const paths = {
css: './dist/css',
js: './dist/js',
html: './dist/pages',
assets: './dist/assets',
vendor: './dist/vendor'
assets: './dist/assets'
},
src: {
base: './src/',
@ -44,16 +42,14 @@ const paths = {
assets: './src/assets/**/*.*',
partials: './src/partials/**/*.html',
scss: './src/scss',
ts: './src/ts',
nodeModules: './node_modules/'
ts: './src/ts'
},
temp: {
base: './.temp/',
css: './.temp/css',
js: './.temp/js',
html: './.temp/pages',
assets: './.temp/assets',
vendor: './.temp/vendor'
assets: './.temp/assets'
}
}
@ -151,12 +147,9 @@ const html = () => src([paths.src.html])
.pipe(dest(paths.temp.html))
.pipe(browserSync.stream())
const lintHtml = () => src([paths.temp.html + '/**/*.html', paths.src.base + '*.html'])
const lintHtml = () => src([paths.temp.html + '/**/*.html', paths.temp.base + '*.html'])
.pipe(validator())
const vendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.nodeModules })
.pipe(dest(paths.temp.vendor))
const serve = () => {
browserSync.init({
server: paths.temp.base
@ -266,17 +259,37 @@ const copyDistHtml = () => src([paths.src.html])
}))
.pipe(dest(paths.dist.html))
const lintDistHtml = () => src([paths.dist.html + '/**/*.html', paths.dist.base + '*.html'])
// HTML Lint
// Copy index for Lint
const copyDistHtmlIndexForLint = () => src([paths.src.base + '*.html'])
.pipe(fileinclude({
prefix: '@@',
basepath: './src/partials/',
context: {
environment: 'production'
}
}))
.pipe(dest(paths.temp.base))
// Copy Html for Lint
const copyDistHtmlForLint = () => src([paths.src.html])
.pipe(fileinclude({
prefix: '@@',
basepath: './src/partials/',
context: {
environment: 'production'
}
}))
.pipe(dest(paths.temp.html))
// Now Lint
const lintDistHtmlCopied = () => src([paths.temp.html + '/**/*.html', paths.temp.base + '*.html'])
.pipe(validator())
// Copy node_modules to vendor
const copyDistVendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.nodeModules })
.pipe(dest(paths.dist.vendor))
const lintDistHtml = series(copyDistHtmlIndexForLint, copyDistHtmlForLint, lintDistHtmlCopied)
const lint = parallel(
lintDistScss,
lintDistTs,
series(copyDistHtmlIndex, copyDistHtml, lintDistHtml)
lintDistHtml
)
exports.lint = lint
@ -290,8 +303,7 @@ const compile = series(
series(copyDistJs, minifyDistJs),
copyDistAssets,
copyDistHtmlIndex,
copyDistHtml,
copyDistVendor
copyDistHtml
)
)
exports.compile = compile
@ -300,4 +312,4 @@ exports.compile = compile
exports.production = series(lint, compile)
// Default - Only for light mode AdminLTE
exports.default = series(scss, scssDark, tsCompile, html, index, assets, vendor, serve)
exports.default = series(scss, scssDark, tsCompile, html, index, assets, serve)

63
package-lock.json generated

@ -8,18 +8,12 @@
"name": "admin-lte",
"version": "4.0.0-alpha1",
"license": "MIT",
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@popperjs/core": "^2.10.2",
"bootstrap": "^5.1.3",
"chart.js": "^3.5.1",
"overlayscrollbars": "^1.13.1"
},
"devDependencies": {
"@rollup/plugin-typescript": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"autoprefixer": "^10.4.0",
"bootstrap": "^5.1.3",
"browser-sync": "^2.27.7",
"bundlewatch": "^0.3.2",
"del": "^6.0.0",
@ -34,7 +28,6 @@
"gulp-file-include": "^2.3.0",
"gulp-html": "^3.5.0",
"gulp-if": "^3.0.0",
"gulp-npm-dist": "^1.0.3",
"gulp-postcss": "^9.0.1",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.0.0",
@ -566,15 +559,6 @@
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/@fortawesome/fontawesome-free": {
"version": "5.15.4",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz",
"integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg==",
"hasInstallScript": true,
"engines": {
"node": ">=6"
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz",
@ -634,6 +618,8 @@
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz",
"integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==",
"dev": true,
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
@ -1488,6 +1474,7 @@
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
"integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
"dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
@ -1816,11 +1803,6 @@
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/chart.js": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.0.tgz",
"integrity": "sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ=="
},
"node_modules/chokidar": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
@ -5105,12 +5087,6 @@
"minimatch": "^3.0.3"
}
},
"node_modules/gulp-npm-dist": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/gulp-npm-dist/-/gulp-npm-dist-1.0.3.tgz",
"integrity": "sha512-7nank8dgqYXOR6K7VM5VdzvAmCGCaudUEbVKOkCVyu+/EK3QuD8PUJ+UlV/f2QWswN0jDXnHlM7FuT2BUt8P3w==",
"dev": true
},
"node_modules/gulp-postcss": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/gulp-postcss/-/gulp-postcss-9.0.1.tgz",
@ -7737,11 +7713,6 @@
"node": ">=0.10.0"
}
},
"node_modules/overlayscrollbars": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/overlayscrollbars/-/overlayscrollbars-1.13.1.tgz",
"integrity": "sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ=="
},
"node_modules/p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
@ -12307,11 +12278,6 @@
}
}
},
"@fortawesome/fontawesome-free": {
"version": "5.15.4",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz",
"integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg=="
},
"@humanwhocodes/config-array": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz",
@ -12358,7 +12324,9 @@
"@popperjs/core": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.2.tgz",
"integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ=="
"integrity": "sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==",
"dev": true,
"peer": true
},
"@rollup/plugin-typescript": {
"version": "8.3.0",
@ -12974,6 +12942,7 @@
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.3.tgz",
"integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==",
"dev": true,
"requires": {}
},
"brace-expansion": {
@ -13218,11 +13187,6 @@
"integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==",
"dev": true
},
"chart.js": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.0.tgz",
"integrity": "sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ=="
},
"chokidar": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz",
@ -15928,12 +15892,6 @@
"minimatch": "^3.0.3"
}
},
"gulp-npm-dist": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/gulp-npm-dist/-/gulp-npm-dist-1.0.3.tgz",
"integrity": "sha512-7nank8dgqYXOR6K7VM5VdzvAmCGCaudUEbVKOkCVyu+/EK3QuD8PUJ+UlV/f2QWswN0jDXnHlM7FuT2BUt8P3w==",
"dev": true
},
"gulp-postcss": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/gulp-postcss/-/gulp-postcss-9.0.1.tgz",
@ -17964,11 +17922,6 @@
"lcid": "^1.0.0"
}
},
"overlayscrollbars": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/overlayscrollbars/-/overlayscrollbars-1.13.1.tgz",
"integrity": "sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ=="
},
"p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",

@ -10,7 +10,7 @@
"lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
"docs-compile": "node -v",
"docs-lint": "node -v",
"lint": "npx gulp lint && lockfile-lint",
"lint": "npx gulp lint && npm run lockfile-lint",
"compile": "npx gulp compile",
"production": "npx gulp production"
},
@ -35,18 +35,12 @@
"bugs": {
"url": "https://github.com/ColorlibHQ/AdminLTE/issues"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"@popperjs/core": "^2.10.2",
"bootstrap": "^5.1.3",
"chart.js": "^3.5.1",
"overlayscrollbars": "^1.13.1"
},
"devDependencies": {
"@rollup/plugin-typescript": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"autoprefixer": "^10.4.0",
"bootstrap": "^5.1.3",
"browser-sync": "^2.27.7",
"bundlewatch": "^0.3.2",
"del": "^6.0.0",
@ -61,7 +55,6 @@
"gulp-file-include": "^2.3.0",
"gulp-html": "^3.5.0",
"gulp-if": "^3.0.0",
"gulp-npm-dist": "^1.0.3",
"gulp-postcss": "^9.0.1",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.0.0",

@ -360,8 +360,10 @@
"path": "."
})
<!-- OPTIONAL SCRIPTS -->
<!-- ChartJS -->
<script src="./vendor/chart.js/dist/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.6.0/dist/chart.min.js" integrity="sha256-7lWo7cjrrponRJcS6bc8isfsPDwSKoaYfGIHgSheQkk=" crossorigin="anonymous"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="./assets/js/dashboard.js"></script>
</body>

@ -834,8 +834,10 @@
"path": "."
})
<!-- OPTIONAL SCRIPTS -->
<!-- ChartJS -->
<script src="./vendor/chart.js/dist/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.6.0/dist/chart.min.js" integrity="sha256-7lWo7cjrrponRJcS6bc8isfsPDwSKoaYfGIHgSheQkk=" crossorigin="anonymous"></script>
<!-- AdminLTE dashboard2 demo (This is only for demo purposes) -->
<script src="./assets/js/dashboard2.js"></script>
</body>

@ -297,8 +297,10 @@
"path": "."
})
<!-- OPTIONAL SCRIPTS -->
<!-- ChartJS -->
<script src="./vendor/chart.js/dist/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.6.0/dist/chart.min.js" integrity="sha256-7lWo7cjrrponRJcS6bc8isfsPDwSKoaYfGIHgSheQkk=" crossorigin="anonymous"></script>
<!-- AdminLTE dashboard3 demo (This is only for demo purposes) -->
<script src="./assets/js/dashboard3.js"></script>
</body>

@ -10,10 +10,20 @@
<meta name="color-scheme" content="light dark">
<!-- By adding @@path/css/dark/adminlte-dark-addon.css then the page supports both dark color schemes, and the page author prefers / default is dark. -->
<!-- <meta name="color-scheme" content="dark light"> -->
<!-- OPTIONAL LINKS -->
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- overlayScrollbars -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/overlayscrollbars@1.13.1/css/OverlayScrollbars.min.css" integrity="sha256-WKijf8KI68sbq8Znd6yMepIuFF0wdWfIt6gk3JWcQfk=" crossorigin="anonymous">
<!-- Font Awesome -->
<link rel="stylesheet" href="@@path/vendor/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css" integrity="sha256-mUZM63G8m73Mcidfrv5E+Y61y7a12O5mW4ezU3bxqW4=" crossorigin="anonymous">
<!-- REQUIRED LINKS -->
<!-- Theme style -->
<link rel="stylesheet" href="@@path/css/adminlte.css">
@ -23,7 +33,3 @@
<!-- For dark mode use @@path/css/dark/adminlte-dark-addon.css, do not remove dist/css/adminlte.css or if usinf RTL version do not remove @@path/css/rtl/adminlte.rtl.css-->
<!-- ... and then the alternate CSS first as a snap-on for dark color scheme preference -->
<!-- <link rel="stylesheet" href="@@path/css/dark/adminlte-dark-addon.css" media="(prefers-color-scheme: dark)""> -->
<!-- overlayScrollbars -->
<link rel="stylesheet" href="@@path/vendor/overlayscrollbars/css/OverlayScrollbars.min.css">

@ -1,7 +1,11 @@
<!-- REQUIRED SCRIPTS -->
<!-- OPTIONAL SCRIPTS -->
<!-- overlayScrollbars -->
<script src="@@path/vendor/overlayscrollbars/js/OverlayScrollbars.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/overlayscrollbars@1.13.1/js/OverlayScrollbars.min.js" integrity="sha256-7mHsZb07yMyUmZE5PP1ayiSGILxT6KyU+a/kTDCWHA8=" crossorigin="anonymous"></script>
<!-- Bootstrap 5 -->
<script src="@@path/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha256-9SEPo+fwJFpMUet/KACSwO+Z/dKMReF9q4zFhU/fT9M=" crossorigin="anonymous"></script>
<!-- REQUIRED SCRIPTS -->
<!-- AdminLTE App -->
<script src="@@path/js/adminlte.js"></script>

Loading…
Cancel
Save