File tree Expand file tree Collapse file tree
robot-stream/output-webview Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 },
2626 "devDependencies" : {
2727 "css-loader" : " ^5.2.6" ,
28+ "html-inline-script-webpack-plugin" : " ^3.1.0" ,
2829 "html-webpack-plugin" : " ^5.3.1" ,
2930 "prettier" : " 2.4.1" ,
3031 "style-loader" : " ^2.0.0" ,
Original file line number Diff line number Diff line change 11const path = require ( "path" ) ;
22const HtmlWebpackPlugin = require ( "html-webpack-plugin" ) ;
3+ const HtmlInlineScriptPlugin = require ( "html-inline-script-webpack-plugin" ) ;
34
45module . exports = ( env ) => {
56 let mode ;
@@ -30,6 +31,19 @@ module.exports = (env) => {
3031 }
3132 console . log ( "Building to: " + target ) ;
3233
34+ let plugins = [
35+ // Generates the index.html
36+ new HtmlWebpackPlugin ( {
37+ title : "Robot Output" ,
38+ template : "./src/index.html" ,
39+ scriptLoading : "blocking" ,
40+ } ) ,
41+ ] ;
42+
43+ if ( mode == "production" ) {
44+ plugins . push ( new HtmlInlineScriptPlugin ( ) ) ;
45+ }
46+
3347 return {
3448 entry : [ "./src/index.ts" , "./src/style.css" ] ,
3549 output : {
@@ -71,14 +85,7 @@ module.exports = (env) => {
7185 resolve : {
7286 extensions : [ ".ts" , ".js" ] ,
7387 } ,
74- plugins : [
75- // Generates the index.html
76- new HtmlWebpackPlugin ( {
77- title : "Robot Output" ,
78- template : "./src/index.html" ,
79- scriptLoading : "blocking" ,
80- } ) ,
81- ] ,
88+ plugins : plugins ,
8289 optimization : {
8390 minimize : minimize ,
8491 } ,
Original file line number Diff line number Diff line change @@ -1497,6 +1497,11 @@ html-entities@^1.3.1:
14971497 resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.4.0.tgz#cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc"
14981498 integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==
14991499
1500+ html-inline-script-webpack-plugin@^3.1.0 :
1501+ version "3.1.0"
1502+ resolved "https://registry.yarnpkg.com/html-inline-script-webpack-plugin/-/html-inline-script-webpack-plugin-3.1.0.tgz#fabffb9b2a6bd8e57785904948283155ee27a7b9"
1503+ integrity sha512-Kscqm4fNWxvQXt+R0o1UV9/ug0iZTEdYKXtrDuyauwI9FUe1azR8QXB3ZHkGupXzLF3lsvWheFb9WZT/a8aKtw==
1504+
15001505html-minifier-terser@^6.0.2 :
15011506 version "6.1.0"
15021507 resolved "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#bfc818934cc07918f6b3669f5774ecdfd48f32ab"
You can’t perform that action at this time.
0 commit comments