forked from OfficeDev/office-js-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
58 lines (57 loc) · 1.35 KB
/
webpack.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const webpack = require('webpack');
const path = require('path');
const DtsBundlePlugin = require('./generate-dts');
const libraryName = 'OfficeHelpers';
const fileName = 'office.helpers.js';
const { version, name: companyName, license, author } = require('./package.json');
module.exports = {
entry: __dirname + '/src/index.ts',
devtool: 'source-map',
output: {
path: __dirname + '/dist',
filename: fileName,
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /(\.html)$/,
loader: 'html-loader',
options: {
exportAsEs6Default: true
}
},
{
enforce: 'pre',
test: /\.ts?$/,
loader: 'tslint-loader'
},
{
test: /\.ts$/,
exclude: /\.spec\.ts$/,
loader: 'awesome-typescript-loader',
options: {
configFileName: 'tsconfig.webpack.json'
}
}
]
},
resolve: {
modules: [
path.resolve('./node_modules'),
path.resolve('./src')
],
extensions: ['.json', '.js', '.ts', '.html']
},
plugins: [
new webpack.BannerPlugin({
banner: `${companyName} v.${version}
Copyright (c) ${author}. All rights reserved.
Licensed under the ${license} license.`
}),
new webpack.NamedModulesPlugin(),
new DtsBundlePlugin()
]
};