File tree 3 files changed +25
-2
lines changed
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 13
13
" README.md"
14
14
],
15
15
"scripts" : {
16
- "build" : " rimraf dist/* && rollup -c" ,
16
+ "build" : " rimraf dist/* && rollup -c && node rewrite-map.js " ,
17
17
"output" : " npm run build && rimraf out/* && build-examples" ,
18
18
"prepack" : " npm run build && rimraf out/*" ,
19
19
"start" : " serve-examples" ,
Original file line number Diff line number Diff line change
1
+
2
+ var fs = require ( 'fs' ) ;
3
+
4
+
5
+ function read ( filename ) {
6
+ return String ( fs . readFileSync ( filename , { encoding :'utf8' } ) ) ;
7
+ }
8
+
9
+ var file = 'dist/ax.css.map' ,
10
+ src = JSON . parse ( read ( file ) ) ,
11
+ pkg = JSON . parse ( read ( 'package.json' ) ) ;
12
+
13
+ src . sources = src . sources . map ( function ( s ) {
14
+ return '../datagrid@' + pkg . version + '/css/' + s ;
15
+ } ) ;
16
+
17
+
18
+ fs . writeFileSync ( file , JSON . stringify ( src ) ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import postcss from 'rollup-plugin-postcss';
5
5
import sourcemaps from 'rollup-plugin-sourcemaps' ;
6
6
import fs from 'fs' ;
7
7
import path from 'path' ;
8
+ import rootpkg from './package.json' ;
8
9
9
10
10
11
let name = 'ActiveWidgets.JS' ,
@@ -73,7 +74,11 @@ let bundles = roots.bundles.map(dir => {
73
74
74
75
let input = path . join ( dir , 'index.js' ) ,
75
76
file = path . join ( 'dist' , ( dir || 'ax' ) + '.js' ) ,
76
- sourcemapPathTransform = s => s . replace ( 'node_modules' , '../..' ) ,
77
+ sourcemapPathTransform = s => {
78
+ return s . replace ( / ^ \. \. ./ , '' )
79
+ . replace ( / n o d e _ m o d u l e s / , '..' )
80
+ . replace ( / @ a c t i v e w i d g e t s .( \w + ) / , '$1@' + rootpkg . version ) ;
81
+ } ,
77
82
sourcemap = true ,
78
83
compact = true ;
79
84
You can’t perform that action at this time.
0 commit comments