File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 58
58
" *.json" ,
59
59
" *.js"
60
60
],
61
+ "typings" : " ./dist/main.d.ts" ,
61
62
"main" : " ./dist/vue-tailwind.umd.js"
62
63
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * These are some necessary steps changing the default webpack config of the Vue CLI
3
+ * that need to be changed in order for TypeScript based components to generate their
4
+ * declaration (.d.ts) files.
5
+ * Code by various users from https://github.com/vuejs/vue-cli/issues/1081
6
+ */
7
+ const fixEmitDeclarationFilesForTypeScript = {
8
+ chainWebpack : config => {
9
+ if ( process . env . NODE_ENV === "production" ) {
10
+ config . module . rule ( "ts" ) . uses . delete ( "cache-loader" ) ;
11
+ config . module
12
+ . rule ( "ts" )
13
+ . use ( "ts-loader" )
14
+ . loader ( "ts-loader" )
15
+ . tap ( options => ( {
16
+ ...options ,
17
+ transpileOnly : false ,
18
+ happyPackMode : false
19
+ } ) ) ;
20
+ }
21
+ } ,
22
+ parallel : false
23
+ } ;
24
+
25
+ module . exports = {
26
+ ...fixEmitDeclarationFilesForTypeScript
27
+ } ;
You can’t perform that action at this time.
0 commit comments