forked from SharePoint/PnP-JS-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-serve.config.js
41 lines (40 loc) · 1.01 KB
/
webpack-serve.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
var path = require("path"),
pkg = require("./package.json"),
webpack = require('webpack');
module.exports = {
// serve config
cache: true,
entry: './src/pnp.ts',
output: {
path: path.join(__dirname, "dist"),
publicPath: "/assets/",
filename: "pnp.js",
libraryTarget: "umd",
library: "$pnp"
},
devtool: "source-map",
resolve: {
enforceExtension: false,
extensions: ['.ts']
},
plugins: [
new webpack.NormalModuleReplacementPlugin(/\.\.\/net\/nodefetchclient/, "../net/nodefetchclientbrowser"),
],
module: {
rules: [
{
test: /\.ts$/,
use: [{
loader: "ts-loader"
},
{
loader: "string-replace-loader",
options: {
search: "$$Version$$",
replace: pkg.version
}
}]
},
]
}
};