You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
990 B

'use strict';
const webpack = require('webpack');
const license = require('license-webpack-plugin');
const BannerWebpackPlugin = require('banner-webpack-plugin');
module.exports = {
entry: './source/index.ts',
target: 'node',
node: false, // Disables polyfill Node.js globals
devtool: 'source-map',
output: {
filename: 'dist/index.js',
libraryTarget: 'var',
library: 'ow'
},
resolve: {
extensions: ['.ts', '.js']
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
// For CommonJS default export support
new BannerWebpackPlugin({
chunks: {
main: {
afterContent: `module.exports = ow.default;\nmodule.exports.default = ow.default;\n//# sourceMappingURL=index.js.map`,
removeAfter: '//# sourceMappingURL=index.js.map'
}
}
}),
new license.LicenseWebpackPlugin({
pattern: /.*/,
outputFilename: 'dist/licenses.txt'
})
],
module: {
rules: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader'
}
]
}
};