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

Function targetOutputs

scripts/webpack.js:136–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134const cjsPath = path.resolve(process.cwd(), 'dist/cjs');
135
136function targetOutputs() {
137 console.log(`Building [${pkg.name}, library: ${toGlobalName(pkg.name)}]`);
138 return {
139 umd: {
140 path: umdPath,
141 filename: `${pkg.name}.js`,
142 library: toGlobalName(pkg.name),
143 libraryTarget: 'umd',
144 libraryExport: toGlobalName(pkg.name),
145 umdNamedDefine: true,
146 globalObject: 'window',
147 },
148 umddir: {
149 path: umdDirPath,
150 filename: `index.js`,
151 library: toGlobalName(pkg.name),
152 libraryTarget: 'umd',
153 libraryExport: toGlobalName(pkg.name),
154 umdNamedDefine: true,
155 globalObject: 'window',
156 },
157 cjs: {
158 path: cjsPath,
159 filename: 'index.js',
160 library: toGlobalName(pkg.name),
161 libraryTarget: 'window',
162 },
163 };
164}
165
166const umdExternals = Object.keys(pkg.peerDependencies || {}).reduce((previous, key) => {
167 if (!externals[key]) throw `Missing external [${key}]`;

Callers 1

baseConfigFunction · 0.85

Calls 1

toGlobalNameFunction · 0.85

Tested by

no test coverage detected