crypto-pro-js/webpack.config.js
2020-03-28 21:11:00 +03:00

33 lines
845 B
JavaScript
Executable File

const path = require('path');
const packageJson = require('./package.json');
const tsConfig = require(`./${process.env.TS_CONFIG}`);
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: `./${packageJson.name}.ts`,
module: {
rules: [{
test: /\.ts$/,
use: [{
loader: 'ts-loader',
options: {
configFile: process.env.TS_CONFIG
},
}],
exclude: /node_modules/
}]
},
resolve: {
extensions: ['.ts', '.js']
},
output: {
path: path.resolve(__dirname, tsConfig.compilerOptions.outDir),
filename: process.env.NODE_ENV === 'production' ? `${packageJson.name}.min.js` : `${packageJson.name}.js`,
libraryTarget: 'umd',
library: 'cryptoPro',
umdNamedDefine: true
},
mode: process.env.NODE_ENV || 'development',
devtool: 'source-map'
};