MCPcopy Create free account
hub / github.com/decaporg/decap-cms / targetOutputs

Function targetOutputs

scripts/webpack.js:90–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88const cjsPath = path.resolve(process.cwd(), 'dist/cjs');
89
90function targetOutputs() {
91 console.log(`Building [${pkg.name}, library: ${toGlobalName(pkg.name)}]`);
92 return {
93 umd: {
94 path: umdPath,
95 filename: `${pkg.name}.js`,
96 library: toGlobalName(pkg.name),
97 libraryTarget: 'umd',
98 libraryExport: toGlobalName(pkg.name),
99 umdNamedDefine: true,
100 globalObject: 'window',
101 },
102 umddir: {
103 path: umdDirPath,
104 filename: `index.js`,
105 library: toGlobalName(pkg.name),
106 libraryTarget: 'umd',
107 libraryExport: toGlobalName(pkg.name),
108 umdNamedDefine: true,
109 globalObject: 'window',
110 },
111 cjs: {
112 path: cjsPath,
113 filename: 'index.js',
114 library: toGlobalName(pkg.name),
115 libraryTarget: 'window',
116 },
117 };
118}
119
120const umdExternals = Object.keys(pkg.peerDependencies || {}).reduce((previous, key) => {
121 if (!externals[key]) throw `Missing external [${key}]`;

Callers 1

baseConfigFunction · 0.85

Calls 1

toGlobalNameFunction · 0.85

Tested by

no test coverage detected