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

Function targetOutputs

scripts/webpack.js:124–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122const cjsPath = path.resolve(process.cwd(), 'dist/cjs');
123
124function targetOutputs() {
125 console.log(`Building [${pkg.name}, library: ${toGlobalName(pkg.name)}]`);
126 return {
127 umd: {
128 path: umdPath,
129 filename: `${pkg.name}.js`,
130 library: toGlobalName(pkg.name),
131 libraryTarget: 'umd',
132 libraryExport: toGlobalName(pkg.name),
133 umdNamedDefine: true,
134 globalObject: 'window',
135 },
136 umddir: {
137 path: umdDirPath,
138 filename: `index.js`,
139 library: toGlobalName(pkg.name),
140 libraryTarget: 'umd',
141 libraryExport: toGlobalName(pkg.name),
142 umdNamedDefine: true,
143 globalObject: 'window',
144 },
145 cjs: {
146 path: cjsPath,
147 filename: 'index.js',
148 library: toGlobalName(pkg.name),
149 libraryTarget: 'window',
150 },
151 };
152}
153
154const umdExternals = Object.keys(pkg.peerDependencies || {}).reduce((previous, key) => {
155 if (!externals[key]) throw `Missing external [${key}]`;

Callers 1

baseConfigFunction · 0.85

Calls 1

toGlobalNameFunction · 0.85

Tested by

no test coverage detected