File tree 5 files changed +30
-35
lines changed
5 files changed +30
-35
lines changed Original file line number Diff line number Diff line change 1
- .idea
2
- public
3
1
node_modules
4
2
temp
5
- / nbproject / private /
6
- * .log
3
+ * .log
4
+ .idea
Original file line number Diff line number Diff line change 23
23
"prod-test" : " karma start test/config/karma.conf.js" ,
24
24
"dev-build" : " webpack --config webpack/config.js" ,
25
25
"dev-test" : " karma start test/config/karma.conf.js" ,
26
- "test" : " concurrently --kill-others --raw \" npm run dev-build \" \" npm run dev- test\" " ,
26
+ "test" : " npm run dev-test" ,
27
27
"build" : " npm run prod-build && npm run prod-test"
28
28
},
29
29
"devDependencies" : {
41
41
"karma-firefox-launcher" : " ^1.0.1" ,
42
42
"karma-ie-launcher" : " ^1.0.0" ,
43
43
"karma-jasmine" : " ^1.1.0" ,
44
+ "karma-sourcemap-loader" : " ^0.3.7" ,
44
45
"karma-webpack" : " ^2.0.6" ,
45
46
"webpack" : " ^3.8.1"
46
47
},
Original file line number Diff line number Diff line change 1
- var scrollerPath = '../../temp/'
2
-
3
- var files = [
1
+ const files = [
4
2
'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js' ,
5
3
'https://ajax.googleapis.com/ajax/libs/angularjs/1.6.5/angular.js' ,
6
4
'https://ajax.googleapis.com/ajax/libs/angularjs/1.6.5/angular-mocks.js' ,
@@ -10,20 +8,18 @@ var files = [
10
8
'../*Spec.js'
11
9
] ;
12
10
13
- module . exports . development = files . concat ( [
14
- '../../temp/ui-scroll.js' ,
15
- '../../temp/ui-scroll-grid.js' ,
16
- {
17
- pattern : '../../temp/*.js.map' ,
18
- included : false
19
- }
20
- ] ) ;
11
+ module . exports . development = [
12
+ ...files ,
13
+ '../../src/ui-scroll.js' ,
14
+ '../../src/ui-scroll-grid.js'
15
+ ] ;
21
16
22
- module . exports . production = files . concat ( [
17
+ module . exports . production = [
18
+ ...files ,
23
19
'../../dist/ui-scroll.min.js' ,
24
20
'../../dist/ui-scroll-grid.min.js' ,
25
21
{
26
22
pattern : '../../dist/*.js.map' ,
27
23
included : false
28
24
}
29
- ] ) ;
25
+ ] ;
Original file line number Diff line number Diff line change @@ -4,28 +4,24 @@ const ie = 'IE';
4
4
5
5
const ENV = ( process . env . npm_lifecycle_event . indexOf ( 'dev' ) === 0 ) ? 'development' : 'production' ;
6
6
7
+ const webpackSettings = ENV === 'development' ? {
8
+ preprocessors : {
9
+ '../../src/ui-scroll*.js' : [ 'webpack' , 'sourcemap' ]
10
+ } ,
11
+ webpack : require ( '../../webpack/config.js' )
12
+ } : { } ;
13
+
7
14
module . exports = function ( config ) {
8
- config . set ( {
15
+ config . set ( Object . assign ( {
9
16
10
17
basePath : '' ,
11
18
12
19
frameworks : [ 'jasmine' ] ,
13
20
14
21
files : [
15
- ...require ( './karma.conf.files.js' ) [ ENV ] ,
16
- {
17
- pattern : '../../src/*.js' ,
18
- watched : true ,
19
- served : false
20
- }
22
+ ...require ( './karma.conf.files.js' ) [ ENV ]
21
23
] ,
22
24
23
- preprocessors : {
24
- '../../src/*.js' : [ 'webpack' ]
25
- } ,
26
-
27
- webpack : { } ,
28
-
29
25
exclude : [ ] ,
30
26
31
27
reporters : [ 'dots' ] ,
@@ -46,8 +42,7 @@ module.exports = function (config) {
46
42
47
43
captureTimeout : 60000 ,
48
44
49
- singleRun : ENV !== 'development' ,
45
+ singleRun : ENV !== 'development'
50
46
51
- // restartOnFileChange: true
52
- } ) ;
47
+ } , webpackSettings ) ) ;
53
48
} ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const getBanner = function (compressing) {
13
13
} ;
14
14
15
15
const ENV = ( process . env . npm_lifecycle_event . indexOf ( 'dev' ) === 0 ) ? 'development' : 'production' ;
16
+ console . log ( '********** webpack runs in ' + ENV + ' environment **********\n' ) ;
16
17
17
18
let configEnv = { } ;
18
19
@@ -22,6 +23,8 @@ if (ENV === 'development') {
22
23
23
24
compressing : false ,
24
25
26
+ devtool : 'inline-source-map' ,
27
+
25
28
entry : { } ,
26
29
27
30
plugins : [ ] ,
@@ -36,6 +39,8 @@ if (ENV === 'production') {
36
39
37
40
compressing : true ,
38
41
42
+ devtool : 'source-map' ,
43
+
39
44
entry : {
40
45
'ui-scroll.min' : path . resolve ( __dirname , '../src/ui-scroll.js' ) ,
41
46
'ui-scroll-grid.min' : path . resolve ( __dirname , '../src/ui-scroll-grid.js' )
@@ -75,7 +80,7 @@ module.exports = {
75
80
76
81
cache : false ,
77
82
78
- devtool : 'source-map' ,
83
+ devtool : configEnv . devtool ,
79
84
80
85
module : {
81
86
rules : [
You can’t perform that action at this time.
0 commit comments