File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1313 " README.md"
1414 ],
1515 "scripts" : {
16- "build" : " rimraf dist/* && rollup -c" ,
16+ "build" : " rimraf dist/* && rollup -c && node rewrite-map.js " ,
1717 "output" : " npm run build && rimraf out/* && build-examples" ,
1818 "prepack" : " npm run build && rimraf out/*" ,
1919 "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';
55import sourcemaps from 'rollup-plugin-sourcemaps' ;
66import fs from 'fs' ;
77import path from 'path' ;
8+ import rootpkg from './package.json' ;
89
910
1011let name = 'ActiveWidgets.jQuery' ,
@@ -74,7 +75,11 @@ let bundles = roots.bundles.map(dir => {
7475
7576 let input = path . join ( dir , 'index.js' ) ,
7677 file = path . join ( 'dist' , ( dir || 'ax' ) + '.js' ) ,
77- sourcemapPathTransform = s => s . replace ( 'node_modules' , '../..' ) ,
78+ sourcemapPathTransform = s => {
79+ return s . replace ( / ^ \. \. ./ , '' )
80+ . replace ( / n o d e _ m o d u l e s / , '..' )
81+ . replace ( / @ a c t i v e w i d g e t s .( \w + ) / , '$1@' + rootpkg . version ) ;
82+ } ,
7883 sourcemap = true ,
7984 compact = true ;
8085
You can’t perform that action at this time.
0 commit comments