File tree Expand file tree Collapse file tree 5 files changed +75
-6
lines changed Expand file tree Collapse file tree 5 files changed +75
-6
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "presets" : [
3+ [" env" , {
4+ "modules" : false ,
5+ "targets" : {
6+ "browsers" : [" > 1%" , " last 2 versions" , " not ie <= 8" ]
7+ }
8+ }],
9+ " stage-2"
10+ ],
11+ "plugins" : [" transform-runtime" ],
12+ "env" : {
13+ "test" : {
14+ "presets" : [" env" , " stage-2" ],
15+ "plugins" : [" istanbul" ]
16+ }
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ root = true
2+
3+ [* ]
4+ charset = utf-8
5+ indent_style = space
6+ indent_size = 2
7+ end_of_line = lf
8+ insert_final_newline = true
9+ trim_trailing_whitespace = true
Original file line number Diff line number Diff line change 1+ // http://eslint.org/docs/user-guide/configuring
2+
3+ module . exports = {
4+ root : true ,
5+ parser : 'babel-eslint' ,
6+ parserOptions : {
7+ sourceType : 'module'
8+ } ,
9+ env : {
10+ browser : false ,
11+ node : true ,
12+ es6 : true
13+ } ,
14+ // https://github.com/standard/standard/blob/master/docs/RULES-en.md
15+ extends : 'standard' ,
16+ // required to lint *.vue files
17+ plugins : [
18+ 'html'
19+ ] ,
20+ // add your custom rules here
21+ 'rules' : {
22+ // allow paren-less arrow functions
23+ 'arrow-parens' : 0 ,
24+ // allow async-await
25+ 'generator-star-spacing' : 0 ,
26+ // allow debugger during development
27+ 'no-debugger' : process . env . NODE_ENV === 'production' ? 2 : 0
28+ } ,
29+ globals : {
30+ App : true ,
31+ Page : true ,
32+ wx : true ,
33+ getApp : true ,
34+ getPage : true ,
35+ requirePlugin : true
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
2+ const relative = require ( 'relative' ) ;
3+
14function MpvuePlugin ( ) { }
25
36MpvuePlugin . prototype . apply = function ( compiler ) {
4- const { options : { entry, plugins} } = compiler ;
57 compiler . plugin ( 'emit' , function ( compilation , callback ) {
68 let commonsChunkNames = [ ] ;
79 // 获取所有的 chunk name
@@ -15,7 +17,7 @@ MpvuePlugin.prototype.apply = function(compiler) {
1517 compilation . chunks . forEach ( commonChunk => {
1618 const { files, chunks : childChunks , name } = commonChunk ;
1719 let commonWxssFile = files . find ( item => item . endsWith ( '.wxss' ) ) ;
18-
20+
1921 if ( commonsChunkNames . indexOf ( name ) > - 1 && commonWxssFile ) {
2022 childChunks . forEach ( item => {
2123 let wxssFile = item . files . find ( item => item . endsWith ( '.wxss' ) ) ;
@@ -30,10 +32,10 @@ MpvuePlugin.prototype.apply = function(compiler) {
3032 console . error ( error , wxssFile )
3133 }
3234 } )
33- }
34- } ) ;
35+ } )
36+ } )
3537 callback ( ) ;
3638 } ) ;
3739} ;
3840
39- module . exports = MpvuePlugin ;
41+ module . exports = MpvuePlugin ;
Original file line number Diff line number Diff line change 2222 "url" : " https://github.com/mpvue/webpack-mpvue-asset-plugin/issues"
2323 },
2424 "homepage" : " https://github.com/mpvue/webpack-mpvue-asset-plugin#readme" ,
25- "description" : " "
25+ "description" : " " ,
26+ "dependencies" : {
27+ "relative" : " ^3.0.2"
28+ }
2629}
You can’t perform that action at this time.
0 commit comments