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
+
1
4
function MpvuePlugin ( ) { }
2
5
3
6
MpvuePlugin . prototype . apply = function ( compiler ) {
4
- const { options : { entry, plugins} } = compiler ;
5
7
compiler . plugin ( 'emit' , function ( compilation , callback ) {
6
8
let commonsChunkNames = [ ] ;
7
9
// 获取所有的 chunk name
@@ -15,7 +17,7 @@ MpvuePlugin.prototype.apply = function(compiler) {
15
17
compilation . chunks . forEach ( commonChunk => {
16
18
const { files, chunks : childChunks , name } = commonChunk ;
17
19
let commonWxssFile = files . find ( item => item . endsWith ( '.wxss' ) ) ;
18
-
20
+
19
21
if ( commonsChunkNames . indexOf ( name ) > - 1 && commonWxssFile ) {
20
22
childChunks . forEach ( item => {
21
23
let wxssFile = item . files . find ( item => item . endsWith ( '.wxss' ) ) ;
@@ -30,10 +32,10 @@ MpvuePlugin.prototype.apply = function(compiler) {
30
32
console . error ( error , wxssFile )
31
33
}
32
34
} )
33
- }
34
- } ) ;
35
+ } )
36
+ } )
35
37
callback ( ) ;
36
38
} ) ;
37
39
} ;
38
40
39
- module . exports = MpvuePlugin ;
41
+ module . exports = MpvuePlugin ;
Original file line number Diff line number Diff line change 22
22
"url" : " https://github.com/mpvue/webpack-mpvue-asset-plugin/issues"
23
23
},
24
24
"homepage" : " https://github.com/mpvue/webpack-mpvue-asset-plugin#readme" ,
25
- "description" : " "
25
+ "description" : " " ,
26
+ "dependencies" : {
27
+ "relative" : " ^3.0.2"
28
+ }
26
29
}
You can’t perform that action at this time.
0 commit comments