forked from bpampuch/pdfmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (31 loc) · 862 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
var path = require('path');
var StringReplacePlugin = require("string-replace-webpack-plugin");
module.exports = {
entry: './src/browser-extensions/pdfMake.js',
output: {
path: path.join(__dirname, './build'),
filename: 'pdfmake.js'
},
resolve: {
alias: {
fs: path.join(__dirname, './src/browser-extensions/virtual-fs.js')
}
},
module: {
loaders: [
{ test: /\.json$/, loader: 'json' },
{ test: /pdfMake.js$/, loader: 'expose?pdfMake', include: [ path.join(__dirname, './src/browser-extensions')] },
{ test: /pdfkit[\/\\]js[\/\\]mixins[\/\\]fonts.js$/, loader: StringReplacePlugin.replace({
replacements: [
{
pattern: 'return this.font(\'Helvetica\');',
replacement: ''
}
]})
}
]
},
plugins: [
new StringReplacePlugin()
]
};