-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbundle.js
26 lines (25 loc) · 941 Bytes
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const packageJSON = require('./package.json');
const banner = `/*!
*
* Constructor.io JavaScript Client, version ${packageJSON.version}
* (c) 2015-${new Date().getFullYear()} Constructor.io
* ---
* Constructor Search uses artificial intelligence to provide AI-first search, browse, and recommendations results that increase conversions and revenue.
* - https://constructor.io
* - https://github.com/Constructor-io/constructorio-client-javascript
* ---
* Includes code from the 'browserify/events' library, licensed under the MIT License.
* For full license details, see the library documentation.
*
*/`;
require('esbuild').build({
entryPoints: ['./lib/constructorio.js'],
bundle: true,
minify: true,
define: {
global: 'window',
'process': '{"env":{"BUNDLED":"true"}}',
},
banner: { js: banner },
outfile: `./dist/constructorio-client-javascript-${packageJSON.version}.js`,
}).catch(() => process.exit(1));