forked from antvis/data-set
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (41 loc) · 916 Bytes
/
webpack.config.js
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
const resolve = require('path').resolve;
const pkg = require('./package.json');
module.exports = {
devtool: 'cheap-source-map',
mode: 'development',
entry: {
'data-set': './src/index.ts',
},
resolve: {
extensions: ['.js', '.ts', '.json'],
mainFields: ['browser', 'main', 'module'],
},
output: {
filename: '[name].js',
library: 'DataSet',
libraryTarget: 'umd',
path: resolve(__dirname, 'build/'),
},
module: {
rules: [
{
test: /\.(t|j)s$/,
include: [
resolve(__dirname, 'src'),
function(path) {
return /d3-.*/.test(path);
},
],
loader: 'awesome-typescript-loader',
},
{
test: /data\-set\.js$/,
loader: 'string-replace-loader',
options: {
search: '____DATASET_VERSION____',
replace: pkg.version,
},
},
],
},
};