mezon-js 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.mjs ADDED
@@ -0,0 +1,45 @@
1
+ // Copyright 2020 The Mezon Authors
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import esbuild from 'esbuild';
16
+
17
+ // Shared esbuild config
18
+ const config = {
19
+ logLevel: 'info',
20
+ entryPoints: ['index.ts'],
21
+ bundle: true,
22
+ target: 'es6',
23
+ globalName: 'mezonjs'
24
+ };
25
+
26
+ // Build CommonJS
27
+ await esbuild.build({
28
+ ...config,
29
+ format: 'cjs',
30
+ outfile: 'dist/mezon-js.cjs.js'
31
+ });
32
+
33
+ // Build ESM
34
+ await esbuild.build({
35
+ ...config,
36
+ format: 'esm',
37
+ outfile: 'dist/mezon-js.esm.mjs'
38
+ });
39
+
40
+ // Build IIFE
41
+ await esbuild.build({
42
+ ...config,
43
+ format: 'iife',
44
+ outfile: 'dist/mezon-js.iife.js'
45
+ });