File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed
Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 5050 "eslint-plugin-promise" : " ^3.5.0" ,
5151 "eslint-plugin-standard" : " ^3.0.1" ,
5252 "file-loader" : " ^0.11.1" ,
53+ "iview-weapp" : " ^2.0.0" ,
5354 "jest" : " ^19.0.2" ,
5455 "mkdirp" : " ^0.5.1" ,
5556 "rimraf" : " ^2.6.1" ,
Original file line number Diff line number Diff line change 11{
22 "usingComponents" : {
3- "index-component" : " ../../components/index-component/index-component"
3+ "index-component" : " ../../components/index-component/index-component" ,
4+ "i-alert" : " ../../components/iview-weapp/dist/alert/index"
45 }
56}
Original file line number Diff line number Diff line change 77 <view class="usermotto">
88 <text class="user-motto">{{motto}}</text>
99 <view bindtap="goToSubList">go to subPackages</view>
10+ <i-alert type="success">
11+ An success prompt
12+ </i-alert>
1013 </view>
1114</view>
Original file line number Diff line number Diff line change @@ -35,11 +35,30 @@ export default {
3535 name : '[name].[ext]' ,
3636 }
3737 } ,
38+ {
39+ test : / \. ( w x s s | w x m l | j s o n | p n g ) $ / ,
40+ include : / n o d e _ m o d u l e s / ,
41+ loader : 'file-loader' ,
42+ options : {
43+ useRelativePath : false ,
44+ name : ( filePath ) => {
45+ const flag = 'node_modules/' ;
46+ const index = filePath . indexOf ( flag ) ;
47+ if ( index !== - 1 ) {
48+ const targetPath = filePath . substring ( index + flag . length ) . split ( '.' ) [ 0 ] ;
49+ return `./components/${ targetPath } .[ext]` ;
50+ }
51+ return `[name].[ext]` ;
52+ } ,
53+ }
54+ } ,
3855 ] ,
3956 } ,
4057 plugins : [
4158 new WXAppWebpackPlugin ( {
4259 extensions : [ `.${ ext } ` , '.js' ] ,
60+ externalComponents : [ 'iview-weapp' ] ,
61+ externalComponentsDirectory : '../../../node_modules/' ,
4362 } ) ,
4463 ] ,
4564 devtool : 'source-map' ,
You can’t perform that action at this time.
0 commit comments