File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 3434 "google-closure-library" : " ^20220104.0.0" ,
3535 "gulp" : " ^4.0.2" ,
3636 "gulp-rename" : " ^2.0.0" ,
37- "gulp-uglify" : " ^3.0.2" ,
3837 "gulp-typescript" : " ^6.0.0-alpha.1" ,
38+ "gulp-uglify" : " ^3.0.2" ,
3939 "gulp-wrap" : " ^0.15.0" ,
4040 "jasmine" : " ^4.0.2" ,
4141 "tsd" : " ^0.19.1" ,
4747 "test" : " npm run build && npm run test:types && phantomjs js/run_jsunit.js js/router_test.html" ,
4848 "test:types" : " tsd" ,
4949 "prepublish" : " npm run build"
50- },
51- "dependencies" : {
52- "webpack-inject-plugin" : " ^1.5.5"
5350 }
5451}
Original file line number Diff line number Diff line change 44const fs = require ( 'fs' ) ;
55const path = require ( 'path' ) ;
66const util = require ( 'util' ) ;
7-
8- const InjectPlugin = require ( 'webpack-inject-plugin' ) . default ;
7+ const webpack = require ( "webpack" ) ;
98
109const execFile = util . promisify ( require ( 'child_process' ) . execFile ) ;
1110const readFile = util . promisify ( fs . readFile ) ;
@@ -90,11 +89,17 @@ class FosRouting {
9089 }
9190 } ) ;
9291
93- new InjectPlugin ( ( ) => {
94- return 'import Routing from "fos-router";' +
95- 'import routes from ' + JSON . stringify ( this . finalTarget ) + ';' +
96- 'Routing.setRoutingData(routes);' ;
97- } ) . apply ( compiler ) ;
92+ new webpack . BannerPlugin ( {
93+ entryOnly : true ,
94+ include : this . finalTarget ? this . finalTarget + ".js" : / \. j s $ / ,
95+ raw : true ,
96+ banner :
97+ 'import Routing from "fos-router";' +
98+ "import routes from " +
99+ JSON . stringify ( this . finalTarget ) +
100+ ";" +
101+ "Routing.setRoutingData(routes);" ,
102+ } ) . apply ( compiler ) ;
98103 }
99104}
100105
You can’t perform that action at this time.
0 commit comments