crypto-pro-js/webpack.config.js

33 lines
845 B
JavaScript
Raw Permalink Normal View History

2020-03-28 20:10:18 +03:00
const path = require('path');
const packageJson = require('./package.json');
const tsConfig = require(`./${process.env.TS_CONFIG}`);
module.exports = {
2020-03-28 20:10:18 +03:00
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'
};