adds js and browser watch tasks
This commit is contained in:
parent
f59f128571
commit
5a8ba507c1
|
|
@ -0,0 +1,14 @@
|
|||
'use strict'
|
||||
|
||||
const pkg = require('../package.json')
|
||||
const year = new Date().getFullYear()
|
||||
|
||||
function getBanner(pluginFilename) {
|
||||
return `/*!
|
||||
* Understrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
|
||||
* Copyright 2013-${year} ${pkg.author}
|
||||
* Licensed under GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
*/`
|
||||
}
|
||||
|
||||
module.exports = getBanner
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
"proxy": "localhost/",
|
||||
"notify": false,
|
||||
"files": ["./css/*.min.css", "./js/*.min.js", "./**/*.php"]
|
||||
};
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const { babel } = require('@rollup/plugin-babel')
|
||||
const { nodeResolve } = require('@rollup/plugin-node-resolve')
|
||||
const banner = require('./banner.js')
|
||||
|
||||
let fileDest = 'theme.js'
|
||||
const external = ['jquery', 'popper.js']
|
||||
const plugins = [
|
||||
babel({
|
||||
// Only transpile our source code
|
||||
exclude: 'node_modules/**',
|
||||
// Include the helpers in the bundle, at most one copy of each
|
||||
babelHelpers: 'bundled'
|
||||
})
|
||||
]
|
||||
const globals = {
|
||||
jquery: 'jQuery', // Ensure we use jQuery which is always available even in noConflict mode
|
||||
'popper.js': 'Popper'
|
||||
}
|
||||
|
||||
|
||||
fileDest = 'theme.js'
|
||||
// Remove last entry in external array to bundle Popper
|
||||
external.pop()
|
||||
delete globals['popper.js']
|
||||
plugins.push(nodeResolve())
|
||||
|
||||
|
||||
module.exports = {
|
||||
input: path.resolve(__dirname, '../src/js/custom-javascript.js'),
|
||||
output: {
|
||||
banner,
|
||||
file: path.resolve(__dirname, `../js/${fileDest}`),
|
||||
format: 'umd',
|
||||
globals,
|
||||
name: 'understrap'
|
||||
},
|
||||
external,
|
||||
plugins
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"browserSyncOptions": {
|
||||
"proxy": "localhost/",
|
||||
"notify": false,
|
||||
"files": ["./css/*.min.css", "./js/*.min.js", "./**/*.php"]
|
||||
},
|
||||
"paths": {
|
||||
"js": "./js",
|
||||
"css": "./css",
|
||||
"fonts": "./fonts",
|
||||
"img": "./img",
|
||||
"imgsrc": "./src/img",
|
||||
"sass": "./sass",
|
||||
"node": "./node_modules",
|
||||
"composer": "./vendor",
|
||||
"dev": "./src",
|
||||
"dist": "./dist",
|
||||
"distprod": "./dist-product"
|
||||
},
|
||||
"colors": [
|
||||
"--blue",
|
||||
"--indigo",
|
||||
"--purple",
|
||||
"--pink",
|
||||
"--red",
|
||||
"--orange",
|
||||
"--yellow",
|
||||
"--green",
|
||||
"--teal",
|
||||
"--cyan",
|
||||
"--white",
|
||||
"--gray",
|
||||
"--gray-dark"
|
||||
]
|
||||
}
|
||||
365
gulpfile.js
365
gulpfile.js
|
|
@ -1,365 +0,0 @@
|
|||
// Defining requirements
|
||||
var gulp = require( 'gulp' );
|
||||
var plumber = require( 'gulp-plumber' );
|
||||
var sass = require( 'gulp-sass' )( require( 'sass' ) );
|
||||
var babel = require( 'gulp-babel' );
|
||||
var postcss = require( 'gulp-postcss' );
|
||||
var rename = require( 'gulp-rename' );
|
||||
var concat = require( 'gulp-concat' );
|
||||
var uglify = require( 'gulp-uglify' );
|
||||
var imagemin = require( 'gulp-imagemin' );
|
||||
var sourcemaps = require( 'gulp-sourcemaps' );
|
||||
var browserSync = require( 'browser-sync' ).create();
|
||||
var del = require( 'del' );
|
||||
var cleanCSS = require( 'gulp-clean-css' );
|
||||
var autoprefixer = require( 'autoprefixer' );
|
||||
var fs = require('fs');
|
||||
|
||||
// Configuration file to keep your code DRY
|
||||
var cfg = require( './gulpconfig.json' );
|
||||
var paths = cfg.paths;
|
||||
var colors = cfg.colors;
|
||||
|
||||
/**
|
||||
* Compiles .scss to .css files.
|
||||
*
|
||||
* Run: gulp sass
|
||||
*/
|
||||
gulp.task( 'sass', function() {
|
||||
return gulp
|
||||
.src( paths.sass + '/*.scss' )
|
||||
.pipe(
|
||||
plumber( {
|
||||
errorHandler( err ) {
|
||||
console.log( err );
|
||||
this.emit( 'end' );
|
||||
},
|
||||
} )
|
||||
)
|
||||
.pipe( sourcemaps.init( { loadMaps: true } ) )
|
||||
.pipe( sass( { errLogToConsole: true } ) )
|
||||
.pipe( postcss( [ autoprefixer() ] ) )
|
||||
.pipe( sourcemaps.write( undefined, { sourceRoot: null } ) )
|
||||
.pipe( gulp.dest( paths.css ) );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Optimizes images and copies images from src to dest.
|
||||
*
|
||||
* Run: gulp imagemin
|
||||
*/
|
||||
gulp.task( 'imagemin', () =>
|
||||
gulp
|
||||
.src( paths.imgsrc + '/**' )
|
||||
.pipe(
|
||||
imagemin(
|
||||
[
|
||||
// Bundled plugins
|
||||
imagemin.gifsicle( {
|
||||
interlaced: true,
|
||||
optimizationLevel: 3,
|
||||
} ),
|
||||
imagemin.mozjpeg( {
|
||||
quality: 100,
|
||||
progressive: true,
|
||||
} ),
|
||||
imagemin.optipng(),
|
||||
imagemin.svgo(),
|
||||
],
|
||||
{
|
||||
verbose: true,
|
||||
}
|
||||
)
|
||||
)
|
||||
.pipe( gulp.dest( paths.img ) )
|
||||
);
|
||||
|
||||
/**
|
||||
* Minifies css files.
|
||||
*
|
||||
* Run: gulp minifycss
|
||||
*/
|
||||
gulp.task( 'minifycss', function() {
|
||||
return gulp
|
||||
.src( [
|
||||
paths.css + '/custom-editor-style.css',
|
||||
paths.css + '/theme.css',
|
||||
] )
|
||||
.pipe(
|
||||
sourcemaps.init( {
|
||||
loadMaps: true,
|
||||
} )
|
||||
)
|
||||
.pipe(
|
||||
cleanCSS( {
|
||||
compatibility: '*',
|
||||
} )
|
||||
)
|
||||
.pipe(
|
||||
plumber( {
|
||||
errorHandler( err ) {
|
||||
console.log( err );
|
||||
this.emit( 'end' );
|
||||
},
|
||||
} )
|
||||
)
|
||||
.pipe( rename( { suffix: '.min' } ) )
|
||||
.pipe( sourcemaps.write( './' ) )
|
||||
.pipe( gulp.dest( paths.css ) );
|
||||
} );
|
||||
|
||||
|
||||
/**
|
||||
* Minifies css files.
|
||||
*
|
||||
* Run: gulp minifycss
|
||||
*/
|
||||
gulp.task( 'gen-palette', function() {
|
||||
return gulp
|
||||
.src( [
|
||||
paths.css + '/custom-editor-style.css',
|
||||
paths.css + '/theme.css',
|
||||
] )
|
||||
.pipe( postcss( [ function( css, opts) {
|
||||
var colorJson = {};
|
||||
css.walkDecls(function(decl){
|
||||
if ( colors.indexOf( decl.prop ) > -1 ) {
|
||||
colorJson[decl.prop] = decl.value;
|
||||
}
|
||||
});
|
||||
fs.writeFile('inc/editor-color-palette.json', JSON.stringify(colorJson), function(){});
|
||||
return colorJson;
|
||||
} ] ) )
|
||||
} );
|
||||
|
||||
|
||||
/**
|
||||
* Delete minified CSS files and their maps
|
||||
*
|
||||
* Run: gulp cleancss
|
||||
*/
|
||||
gulp.task( 'cleancss', function() {
|
||||
return del( paths.css + '/*.min.css*' );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Compiles .scss to .css minifies css files.
|
||||
*
|
||||
* Run: gulp styles
|
||||
*/
|
||||
gulp.task( 'styles', function( callback ) {
|
||||
gulp.series( 'sass', 'minifycss', 'gen-palette' )( callback );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Watches .scss, .js and image files for changes.
|
||||
* On change re-runs corresponding build task.
|
||||
*
|
||||
* Run: gulp watch
|
||||
*/
|
||||
gulp.task( 'watch', function() {
|
||||
gulp.watch(
|
||||
[ paths.sass + '/**/*.scss', paths.sass + '/*.scss' ],
|
||||
gulp.series( 'styles' )
|
||||
);
|
||||
gulp.watch(
|
||||
[
|
||||
paths.dev + '/js/**/*.js',
|
||||
'js/**/*.js',
|
||||
'!js/theme.js',
|
||||
'!js/theme.min.js',
|
||||
],
|
||||
gulp.series( 'scripts' )
|
||||
);
|
||||
|
||||
// Inside the watch task.
|
||||
gulp.watch( paths.imgsrc + '/**', gulp.series( 'imagemin-watch' ) );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Starts browser-sync task for starting the server.
|
||||
*
|
||||
* Run: gulp browser-sync
|
||||
*/
|
||||
gulp.task( 'browser-sync', function() {
|
||||
browserSync.init( cfg.browserSyncOptions );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Ensures the 'imagemin' task is complete before reloading browsers
|
||||
*/
|
||||
gulp.task(
|
||||
'imagemin-watch',
|
||||
gulp.series( 'imagemin', function() {
|
||||
browserSync.reload();
|
||||
} )
|
||||
);
|
||||
|
||||
/**
|
||||
* Starts watcher with browser-sync.
|
||||
* Browser-sync reloads page automatically on your browser.
|
||||
*
|
||||
* Run: gulp watch-bs
|
||||
*/
|
||||
gulp.task( 'watch-bs', gulp.parallel( 'browser-sync', 'watch' ) );
|
||||
|
||||
// Run:
|
||||
// gulp scripts.
|
||||
// Uglifies and concat all JS files into one
|
||||
gulp.task( 'scripts', function() {
|
||||
var scripts = [
|
||||
// Start - All BS4 stuff
|
||||
paths.dev + '/js/bootstrap4/bootstrap.bundle.js',
|
||||
paths.dev + '/js/themejs/*.js',
|
||||
|
||||
// End - All BS4 stuff
|
||||
|
||||
paths.dev + '/js/skip-link-focus-fix.js',
|
||||
|
||||
// Adding currently empty javascript file to add on for your own themes´ customizations
|
||||
// Please add any customizations to this .js file only!
|
||||
paths.dev + '/js/custom-javascript.js',
|
||||
];
|
||||
gulp
|
||||
.src( scripts, { allowEmpty: true } )
|
||||
.pipe( babel( { presets: ['@babel/preset-env'] } ) )
|
||||
.pipe( concat( 'theme.min.js' ) )
|
||||
.pipe( uglify() )
|
||||
.pipe( gulp.dest( paths.js ) );
|
||||
|
||||
return gulp
|
||||
.src( scripts, { allowEmpty: true } )
|
||||
.pipe( babel() )
|
||||
.pipe( concat( 'theme.js' ) )
|
||||
.pipe( gulp.dest( paths.js ) );
|
||||
} );
|
||||
|
||||
// Deleting any file inside the /src folder
|
||||
gulp.task( 'clean-source', function() {
|
||||
return del( [ 'src/**/*' ] );
|
||||
} );
|
||||
|
||||
// Run:
|
||||
// gulp copy-assets.
|
||||
// Copy all needed dependency assets files from node_modules to theme's /js, /scss and /fonts folder. Run this task after npm update
|
||||
|
||||
////////////////// All Bootstrap SASS Assets /////////////////////////
|
||||
gulp.task( 'copy-assets', function( done ) {
|
||||
////////////////// All Bootstrap 4 Assets /////////////////////////
|
||||
// Copy all JS files
|
||||
var stream = gulp
|
||||
.src( paths.node + '/bootstrap/dist/js/**/*.js' )
|
||||
.pipe( gulp.dest( paths.dev + '/js/bootstrap4' ) );
|
||||
|
||||
// Copy all Bootstrap SCSS files
|
||||
gulp
|
||||
.src( paths.node + '/bootstrap/scss/**/*.scss' )
|
||||
.pipe( gulp.dest( paths.dev + '/sass/bootstrap4' ) );
|
||||
|
||||
////////////////// End Bootstrap 4 Assets /////////////////////////
|
||||
|
||||
// Copy all Font Awesome Fonts
|
||||
gulp
|
||||
.src( paths.node + '/font-awesome/fonts/**/*.{ttf,woff,woff2,eot,svg}' )
|
||||
.pipe( gulp.dest( paths.fonts ) );
|
||||
|
||||
// Copy all Font Awesome SCSS files
|
||||
gulp
|
||||
.src( paths.node + '/font-awesome/scss/*.scss' )
|
||||
.pipe( gulp.dest( paths.dev + '/sass/fontawesome' ) );
|
||||
|
||||
done();
|
||||
} );
|
||||
|
||||
// Deleting the files distributed by the copy-assets task
|
||||
gulp.task( 'clean-vendor-assets', function() {
|
||||
return del( [
|
||||
paths.dev + '/js/bootstrap4',
|
||||
paths.dev + '/sass/bootstrap4',
|
||||
paths.fonts + '/*wesome*.{ttf,woff,woff2,eot,svg}',
|
||||
paths.dev + '/sass/fontawesome',
|
||||
paths.js + paths.vendor,
|
||||
] );
|
||||
} );
|
||||
|
||||
/**
|
||||
* Deletes all files inside the dist folder and the folder itself.
|
||||
*
|
||||
* Run: gulp clean-dist
|
||||
*/
|
||||
gulp.task( 'clean-dist', function() {
|
||||
return del( paths.dist );
|
||||
} );
|
||||
|
||||
// Run
|
||||
// gulp dist
|
||||
// Copies the files to the dist folder for distribution as simple theme
|
||||
gulp.task(
|
||||
'dist',
|
||||
gulp.series( [ 'clean-dist' ], function() {
|
||||
return gulp
|
||||
.src(
|
||||
[
|
||||
'**/*',
|
||||
'!' + paths.node,
|
||||
'!' + paths.node + '/**',
|
||||
'!' + paths.dev,
|
||||
'!' + paths.dev + '/**',
|
||||
'!' + paths.dist,
|
||||
'!' + paths.dist + '/**',
|
||||
'!' + paths.distprod,
|
||||
'!' + paths.distprod + '/**',
|
||||
'!' + paths.sass,
|
||||
'!' + paths.sass + '/**',
|
||||
'!' + paths.composer,
|
||||
'!' + paths.composer + '/**',
|
||||
'!+(readme|README).+(txt|md)',
|
||||
'!*.+(dist|json|js|lock|xml)',
|
||||
'!CHANGELOG.md',
|
||||
],
|
||||
{ buffer: true }
|
||||
)
|
||||
.pipe( gulp.dest( paths.dist ) );
|
||||
} )
|
||||
);
|
||||
|
||||
/**
|
||||
* Deletes all files inside the dist-product folder and the folder itself.
|
||||
*
|
||||
* Run: gulp clean-dist-product
|
||||
*/
|
||||
gulp.task( 'clean-dist-product', function() {
|
||||
return del( paths.distprod );
|
||||
} );
|
||||
|
||||
// Run
|
||||
// gulp dist-product
|
||||
// Copies the files to the /dist-prod folder for distribution as theme with all assets
|
||||
gulp.task(
|
||||
'dist-product',
|
||||
gulp.series( [ 'clean-dist-product' ], function() {
|
||||
return gulp
|
||||
.src( [
|
||||
'**/*',
|
||||
'!' + paths.node,
|
||||
'!' + paths.node + '/**',
|
||||
'!' + paths.composer,
|
||||
'!' + paths.composer + '/**',
|
||||
'!' + paths.dist,
|
||||
'!' + paths.dist + '/**',
|
||||
'!' + paths.distprod,
|
||||
'!' + paths.distprod + '/**',
|
||||
] )
|
||||
.pipe( gulp.dest( paths.distprod ) );
|
||||
} )
|
||||
);
|
||||
|
||||
// Run
|
||||
// gulp compile
|
||||
// Compiles the styles and scripts and runs the dist task
|
||||
gulp.task( 'compile', gulp.series( 'styles', 'scripts', 'dist' ) );
|
||||
|
||||
// Run:
|
||||
// gulp
|
||||
// Starts watcher (default task)
|
||||
gulp.task( 'default', gulp.series( 'watch' ) );
|
||||
7034
js/theme.js
7034
js/theme.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1155,6 +1155,76 @@
|
|||
"fastq": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-babel": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz",
|
||||
"integrity": "sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/helper-module-imports": "^7.10.4",
|
||||
"@rollup/pluginutils": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-commonjs": {
|
||||
"version": "20.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-20.0.0.tgz",
|
||||
"integrity": "sha512-5K0g5W2Ol8hAcTHqcTBHiA7M58tfmYi1o9KxeJuuRNpGaTa5iLjcyemBitCBcKXaHamOBBEH2dGom6v6Unmqjg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^3.1.0",
|
||||
"commondir": "^1.0.1",
|
||||
"estree-walker": "^2.0.1",
|
||||
"glob": "^7.1.6",
|
||||
"is-reference": "^1.2.1",
|
||||
"magic-string": "^0.25.7",
|
||||
"resolve": "^1.17.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-node-resolve": {
|
||||
"version": "13.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.4.tgz",
|
||||
"integrity": "sha512-eYq4TFy40O8hjeDs+sIxEH/jc9lyuI2k9DM557WN6rO5OpnC2qXMBNj4IKH1oHrnAazL49C5p0tgP0/VpqJ+/w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^3.1.0",
|
||||
"@types/resolve": "1.17.1",
|
||||
"builtin-modules": "^3.1.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"is-module": "^1.0.0",
|
||||
"resolve": "^1.19.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"resolve": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@rollup/pluginutils": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
|
||||
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/estree": "0.0.39",
|
||||
"estree-walker": "^1.0.1",
|
||||
"picomatch": "^2.2.2"
|
||||
}
|
||||
},
|
||||
"@sindresorhus/is": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
|
||||
|
|
@ -1170,6 +1240,27 @@
|
|||
"defer-to-connect": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"@types/estree": {
|
||||
"version": "0.0.39",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
|
||||
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz",
|
||||
"integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/resolve": {
|
||||
"version": "1.17.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz",
|
||||
"integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
|
|
@ -1593,6 +1684,17 @@
|
|||
"integrity": "sha1-YbU5PxH1JVntEgaTEANDtu2wTdU=",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
|
||||
},
|
||||
"builtin-modules": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz",
|
||||
"integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==",
|
||||
"dev": true
|
||||
},
|
||||
"bytes": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
|
||||
|
|
@ -1815,7 +1917,12 @@
|
|||
"commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
||||
},
|
||||
"commondir": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
|
||||
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
|
||||
"dev": true
|
||||
},
|
||||
"component-bind": {
|
||||
|
|
@ -1981,6 +2088,12 @@
|
|||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||
"dev": true
|
||||
},
|
||||
"deepmerge": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
|
||||
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
|
||||
"dev": true
|
||||
},
|
||||
"defer-to-connect": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz",
|
||||
|
|
@ -2257,6 +2370,12 @@
|
|||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||
"dev": true
|
||||
},
|
||||
"estree-walker": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
|
||||
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
|
||||
"dev": true
|
||||
},
|
||||
"esutils": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||
|
|
@ -2749,6 +2868,15 @@
|
|||
"ci-info": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"is-core-module": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz",
|
||||
"integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"is-date-object": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
|
||||
|
|
@ -2786,6 +2914,12 @@
|
|||
"is-path-inside": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"is-module": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
|
||||
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
|
||||
"dev": true
|
||||
},
|
||||
"is-negative-zero": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
|
||||
|
|
@ -2840,6 +2974,15 @@
|
|||
"integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==",
|
||||
"dev": true
|
||||
},
|
||||
"is-reference": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
|
||||
"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/estree": "*"
|
||||
}
|
||||
},
|
||||
"is-string": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
|
||||
|
|
@ -3093,6 +3236,15 @@
|
|||
"integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==",
|
||||
"dev": true
|
||||
},
|
||||
"magic-string": {
|
||||
"version": "0.25.7",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
|
||||
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"sourcemap-codec": "^1.4.4"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
|
||||
|
|
@ -4025,6 +4177,15 @@
|
|||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"rollup": {
|
||||
"version": "2.56.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz",
|
||||
"integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"run-parallel": {
|
||||
"version": "1.1.9",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz",
|
||||
|
|
@ -4417,8 +4578,7 @@
|
|||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
},
|
||||
"source-map-js": {
|
||||
"version": "0.6.2",
|
||||
|
|
@ -4426,6 +4586,21 @@
|
|||
"integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.19",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
|
||||
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"sourcemap-codec": {
|
||||
"version": "1.4.8",
|
||||
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
||||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
|
||||
"dev": true
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
|
||||
|
|
@ -4642,6 +4817,23 @@
|
|||
"integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==",
|
||||
"dev": true
|
||||
},
|
||||
"terser": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
|
||||
"integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
|
||||
"requires": {
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.7.2",
|
||||
"source-map-support": "~0.5.19"
|
||||
},
|
||||
"dependencies": {
|
||||
"source-map": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
|
||||
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"tfunk": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/tfunk/-/tfunk-4.0.0.tgz",
|
||||
|
|
|
|||
20
package.json
20
package.json
|
|
@ -4,12 +4,18 @@
|
|||
"description": "WordPress Theme framework",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"bs": "browser-sync start --config build/browser-sync.config.js",
|
||||
"css": "npm-run-all css-compile css-postcss css-minify",
|
||||
"css-compile": "sass --style expanded --source-map --embed-sources --no-error-css sass/theme.scss:css/theme.css sass/custom-editor-style.scss:css/custom-editor-style.css",
|
||||
"css-minify": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output css/ --batch --batch-suffix \".min\" \"css/*.css\" \"!css/*.min.css\" \"!css/*rtl*.css\"",
|
||||
"css-postcss": "postcss --config postcss.config.js --replace \"css/*.css\" \"!css/*.rtl*.css\" \"!css/*.min.css\"",
|
||||
"watch": "npm-run-all --parallel watch-*",
|
||||
"watch-css": "nodemon --watch sass/ --ext scss --exec \"npm-run-all css\""
|
||||
"css-postcss": "postcss --config build/postcss.config.js --replace \"css/*.css\" \"!css/*.rtl*.css\" \"!css/*.min.css\"",
|
||||
"js": "npm-run-all js-compile js-minify",
|
||||
"js-compile": "rollup --config build/rollup.config.js --sourcemap",
|
||||
"js-minify": "terser --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=js/theme.js.map,includeSources,url=theme.min.js.map\" --output js/theme.min.js js/theme.js",
|
||||
"watch": "npm-run-all --parallel watch-run-*",
|
||||
"watch-bs": "npm-run-all --parallel bs watch-run-*",
|
||||
"watch-run-css": "nodemon --watch sass/ --ext scss --exec \"npm-run-all css\"",
|
||||
"watch-run-js": "nodemon --watch src/js/ --ext js --exec \"npm-run-all js\""
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12 || >=14"
|
||||
|
|
@ -31,10 +37,15 @@
|
|||
"url": "https://github.com/understrap/understrap/issues"
|
||||
},
|
||||
"homepage": "https://understrap.com",
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
"terser": "^5.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.8",
|
||||
"@babel/preset-env": "^7.14.9",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^20.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||
"autoprefixer": "^10.3.1",
|
||||
"bootstrap": "^4.6.0",
|
||||
"browser-sync": "^2.27.5",
|
||||
|
|
@ -47,6 +58,7 @@
|
|||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.3.6",
|
||||
"postcss-cli": "^8.3.1",
|
||||
"rollup": "^2.56.2",
|
||||
"sass": "^1.37.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -1 +1,36 @@
|
|||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Understrap (v1.0.0): index.js
|
||||
* Licensed under GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import Alert from '../../node_modules/bootstrap/js/src/alert'
|
||||
import Button from '../../node_modules/bootstrap/js/src/button'
|
||||
import Carousel from '../../node_modules/bootstrap/js/src/carousel'
|
||||
import Collapse from '../../node_modules/bootstrap/js/src/collapse'
|
||||
import Dropdown from '../../node_modules/bootstrap/js/src/dropdown'
|
||||
import Modal from '../../node_modules/bootstrap/js/src/modal'
|
||||
import Popover from '../../node_modules/bootstrap/js/src/popover'
|
||||
import Scrollspy from '../../node_modules/bootstrap/js/src/scrollspy'
|
||||
import Tab from '../../node_modules/bootstrap/js/src/tab'
|
||||
import Toast from '../../node_modules/bootstrap/js/src/toast'
|
||||
import Tooltip from '../../node_modules/bootstrap/js/src/tooltip'
|
||||
import Util from '../../node_modules/bootstrap/js/src/util'
|
||||
|
||||
export {
|
||||
Util,
|
||||
Alert,
|
||||
Button,
|
||||
Carousel,
|
||||
Collapse,
|
||||
Dropdown,
|
||||
Modal,
|
||||
Popover,
|
||||
Scrollspy,
|
||||
Tab,
|
||||
Toast,
|
||||
Tooltip
|
||||
}
|
||||
|
||||
// Add your JS customizations here
|
||||
|
|
|
|||
Loading…
Reference in New Issue