1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 'use strict';
- const path = require('path');
- const nodeExternals = require('webpack-node-externals');
- const webpack = require('webpack');
- const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
- const packageJson = require('pjson');
- const WebpackUtils = require('./utils/WebpackUtils').WebpackUtils;
- module.exports = {
- context: path.resolve(__dirname, '..'),
- devtool: 'source-map',
- entry: {
- 'index': './index.ts',
- 'index.cli': './index.cli.ts'
- },
- target: 'node',
- externals: [nodeExternals()],
- module: {
- exprContextCritical: false,
- rules: [
- {
- test: /\.ts$/,
- loader: 'ts-loader',
- options: {
- transpileOnly: true
- }
- }
- ]
- },
- resolve: {
- extensions: ['.ts']
- },
- plugins: [
- new webpack.BannerPlugin(
- {
- banner: WebpackUtils.getBannerText(
- WebpackUtils.getLicenseText(),
- WebpackUtils.getSourceMapSupportImport()
- ),
- raw: true,
- entryOnly: false
- }
- ),
- new webpack.EnvironmentPlugin({
- VERSION: packageJson.version
- }),
- new ForkTsCheckerWebpackPlugin({
- tsconfig: 'src/tsconfig.node.json',
- tslint: './tslint.json'
- })
- ],
- output: {
- libraryTarget: 'commonjs2',
- library: 'JavaScriptObfuscator'
- },
- stats: {
- maxModules: 0
- }
- };
|