-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathwebpack.config.js
65 lines (64 loc) · 1.32 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var path = require("path"),
externals = require("webpack-node-externals"),
DtsBundlePlugin = require("./dts-bundle-plugin"),
VueLoader = require("vue-loader");
module.exports = {
mode: "development", //This is meant to be bundled afterward anyway
context: path.resolve(__dirname, "src"),
entry: {
"vue-golden-layout": "./index.ts",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
libraryTarget: "umd",
library: "vue-golden-layout",
umdNamedDefine: true
},
plugins: [
new DtsBundlePlugin({
name: "vue-golden-layout",
main: "dist/index.d.ts",
baseDir: 'dist',
out: "vue-golden-layout.d.ts",
removeSource: true
}, {
"golden.d.ts": "golden.vue.d.ts",
"utils.js.d.ts": "utils.d.ts"
}),
new VueLoader.VueLoaderPlugin()
],
externals: [
externals()
],
devtool: "source-map",
module: {
rules: [{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: "ts-loader",
options: {
appendTsSuffixTo: [/\.vue$/]
}
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}, {
enforce: "pre",
test: /\.tsx?$/,
exclude: /node_modules/,
use: "source-map-loader"
}, {
test: /\.vue$/,
loader: "vue-loader",
options: {
loaders: {
ts: "ts-loader"
}
}
}]
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".html", ".vue"]
}
};