-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
70 lines (69 loc) · 1.46 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
66
67
68
69
70
var webpack = require("webpack"),
path = require("path"),
externals = require('webpack-node-externals'),
{default: DtsBundlePlugin} = require('webpack-dts-bundle'),
VueLoader = require('vue-loader');
module.exports = {
mode: 'development', //This is meant to be bundled afterward anyway
context: path.resolve(__dirname, 'src'),
entry: {
'v-semantic': ['./index.ts'],
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, "dist"),
libraryTarget: 'umd',
library: 'v-semantic',
umdNamedDefine: true
},
plugins: [
new DtsBundlePlugin({
name: 'v-semantic',
main: 'dist/index.d.ts',
out: 'v-semantic.d.ts',
removeSource: true
}),
new webpack.ProvidePlugin({
$: 'jquery'
}),
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: {
alias: {
lib: path.resolve(__dirname, 'src/lib/'),
components: path.resolve(__dirname, 'src/components/'),
directives: path.resolve(__dirname, 'src/directives/')
},
extensions: [".ts", ".js", '.html', '.vue']
}
};