forked from aws-amplify/amplify-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.mjs
44 lines (38 loc) · 1.06 KB
/
common.mjs
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
const defaultTSConfigPath = './tsconfig.build.json';
const isWatch = process.env.ROLLUP_WATCH === 'true';
/** @type {import("rollup").OutputOptions}*/
export const cjsOutput = {
dir: 'dist/cjs',
format: 'cjs',
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: 'src',
sourcemap: true,
};
export const cjsTSOptions = {
outDir: 'dist/cjs',
declaration: false, // declarations are handled by the ESM build
module: 'CommonJS',
sourceMap: false,
tsconfig: defaultTSConfigPath,
tsBuildInfoFile: 'dist/meta/cjs.tsbuildinfo',
noEmitOnError: !isWatch,
};
/** @type {import("rollup").OutputOptions}*/
export const esmOutput = {
dir: 'dist/esm',
format: 'es',
entryFileNames: '[name].mjs',
preserveModules: true,
preserveModulesRoot: 'src',
sourcemap: true,
};
export const esmTSOptions = {
outDir: 'dist/esm',
sourceMap: false,
tsconfig: defaultTSConfigPath,
tsBuildInfoFile: 'dist/meta/cjs.tsbuildinfo',
noEmitOnError: !isWatch,
};