UNPKG

mcanvas

Version:

the image-composer or image-croper that can draw image/text/watermark or crop the image.

26 lines (23 loc) 639 B
const path = require("path"); const merge = require('webpack-merge'); const nodeExternals = require("webpack-node-externals"); const baseConfig = require('./webpack.base') const resolve = filePath => path.resolve(__dirname, filePath) const env = process.env.ENV const config = { mode: 'production', target: env, entry: [ resolve('../src/index.ts'), ], output: { path: resolve('../dist'), filename: `mcanvas.${env}.js`, library: 'MCanvas', libraryTarget: 'umd' }, } if (env === 'node') { config.externals = [nodeExternals()] } module.exports = merge(baseConfig, config)