Skip to content

Commit f7e6da9

Browse files
committed
docs(example): simplify webpack config
1 parent 8f5bf87 commit f7e6da9

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

example/webpack.config.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,34 @@ module.exports = {
55
filename: 'build.js'
66
},
77
resolve: {
8-
extensions: ['.ts', '.js','tsx']
8+
alias: {
9+
vue$: 'vue/dist/vue.esm.js'
10+
},
11+
extensions: ['.ts', '.tsx', '.js']
912
},
1013
module: {
1114
rules: [
1215
{
1316
test: /\.ts$/,
14-
exclude: /node_modules|vue\/src/,
15-
loader: 'ts-loader',
16-
options: {
17-
appendTsSuffixTo: [/\.vue$/]
17+
exclude: /node_modules/,
18+
use: {
19+
loader: 'ts-loader',
20+
options: {
21+
appendTsSuffixTo: [/\.vue$/]
22+
}
1823
}
1924
},
2025
{
2126
test: /\.tsx$/,
22-
exclude: /node_modules|vue\/src/,
23-
loader:[
24-
{
25-
loader: "babel-loader"
26-
},
27-
{
28-
loader: "ts-loader",
29-
}
27+
exclude: /node_modules/,
28+
use: [
29+
'babel-loader',
30+
'ts-loader'
3031
]
3132
},
3233
{
3334
test: /\.vue$/,
34-
loader: 'vue-loader',
35-
options: {
36-
esModule: true
37-
}
35+
use: ['vue-loader']
3836
}
3937
]
4038
},

0 commit comments

Comments
 (0)