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

Function targetOutputs

scripts/webpack.js:94–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

baseConfigFunction · 0.85

Calls 1

toGlobalNameFunction · 0.85

Tested by

no test coverage detected