PLGSUF5SOMAUMJW4C7VDUUTTXVOJ7GCURHEQZA32TLXWHZXD2B4QC
function configurePlugins(rootDir: string): Plugin[] {
if (process.env.NODE_ENV === 'production') {
const sourcemap = process.env.NODE_ENV !== 'production' || process.env.SOURCEMAPS === 'true'
function configurePlugins(
rootDir: string,
typescript = true,
production = process.env.NODE_ENV === 'production'
): Plugin[] {
const common: Plugin[] = [
resolve({
rootDir,
extensions: ['.mjs', '.js', '.json', '.jsx', '.node'],
}),
commonjs({
sourceMap: sourcemap,
}),
jsonfile({}),
]
if (typescript) {
common.push(ts())
}
if (production) {
dev: true
/@cspotcode/source-map-consumer/0.8.0:
resolution: {integrity: sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==}
engines: {node: '>= 12'}
dev: true
/@cspotcode/source-map-support/0.7.0:
resolution: {integrity: sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==}
engines: {node: '>=12'}
dependencies:
'@cspotcode/source-map-consumer': 0.8.0
dev: true
/@tsconfig/node10/1.0.8:
resolution: {integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==}
dev: true
/@tsconfig/node12/1.0.9:
resolution: {integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==}
dev: true
/@tsconfig/node14/1.0.1:
resolution: {integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==}
dev: true
/@tsconfig/node16/1.0.2:
resolution: {integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==}
dev: true
/ts-node/10.4.0_36929cccfdb926da0bb85cc291f27124:
resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.7.0
'@tsconfig/node10': 1.0.8
'@tsconfig/node12': 1.0.9
'@tsconfig/node14': 1.0.1
'@tsconfig/node16': 1.0.2
'@types/node': 16.11.10
acorn: 8.6.0
acorn-walk: 8.2.0
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 4.5.2
yn: 3.1.1
import gulp from 'gulp'
import sourcemaps from 'gulp-sourcemaps'
import htmlmin from 'gulp-html-minifier-terser'
import lessc from 'gulp-less'
import postcss from 'gulp-postcss'
import cssnano from 'cssnano'
import colorguard from 'colorguard'
const dist = 'packages/dist'
export function html() {
return gulp
.src('index.html')
.pipe(
htmlmin({
collapseBooleanAttributes: true,
collapseWhitespace: true,
quoteCharacter: '"',
removeComments: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
})
)
.pipe(gulp.dest(dist))
}
export function style() {
if (process.env.NODE_ENV !== 'production') {
return gulp
.src('less/style.less')
.pipe(sourcemaps.init())
.pipe(lessc())
.pipe(postcss([colorguard(), cssnano({ preset: 'default' })]))
.pipe(sourcemaps.write())
.pipe(gulp.dest(dist))
} else {
return gulp
.src('less/style.less')
.pipe(lessc())
.pipe(postcss([colorguard(), cssnano({ preset: 'default' })]))
.pipe(gulp.dest(dist))
}
}
export const all = gulp.parallel(html, style)
export const watch = gulp.series(all, () => {
gulp.watch('index.html', html)
gulp.watch(['less/*.less', 'less/*/*.less'], style)
})