AdminLTE/build/esbuild.config.js

34 lines
812 B
JavaScript
Raw Normal View History

2021-03-26 01:16:42 +00:00
'use strict'
const esbuild = require('esbuild')
2021-05-11 19:49:41 +00:00
// const { getTarget } = require('./get.browserslist.target')
2021-03-26 01:16:42 +00:00
2021-05-11 19:49:41 +00:00
const pkg = require('../package')
2021-03-26 01:16:42 +00:00
const year = new Date().getFullYear()
const banner = `/*!
* AdminLTE v${pkg.version} (${pkg.homepage})
* Copyright 2014-${year} ${pkg.author}
* Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
*/`
esbuild.build({
2021-05-11 19:49:41 +00:00
entryPoints: ['ts/adminlte.ts'],
2021-03-26 01:16:42 +00:00
banner: {
js: banner
},
2021-05-09 19:29:06 +00:00
bundle: true,
color: true,
format: 'iife',
sourcemap: true,
2021-05-11 19:49:41 +00:00
target: ['chrome60'],
/* will be enable after release of alpha */
// target: getTarget(['es', 'chrome', 'edge', 'firefox', 'ios', 'safari']),
2021-03-26 01:16:42 +00:00
outfile: 'dist/js/adminlte.js'
2021-05-09 19:29:06 +00:00
}).then(
console.log('build/ts/adminlte.ts is BUILD')
).catch(
error => console.error(error)
)