mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-27 08:36:51 +01:00 
			
		
		
		
	start adding webpack-serve for hot reloading
This commit is contained in:
		
							parent
							
								
									cc58bc9bd5
								
							
						
					
					
						commit
						6ed46c2e75
					
				
							
								
								
									
										12930
									
								
								package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										12930
									
								
								package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -22,6 +22,7 @@ | |||||||
|         "css-loader": "^0.28.11", |         "css-loader": "^0.28.11", | ||||||
|         "extract-text-webpack-plugin": "^4.0.0-beta.0", |         "extract-text-webpack-plugin": "^4.0.0-beta.0", | ||||||
|         "glob-all": "^3.1.0", |         "glob-all": "^3.1.0", | ||||||
|  |         "html-webpack-plugin": "^3.2.0", | ||||||
|         "jquery": "^3.3.1", |         "jquery": "^3.3.1", | ||||||
|         "jwt-decode": "^2.2.0", |         "jwt-decode": "^2.2.0", | ||||||
|         "lodash": "^4.17.5", |         "lodash": "^4.17.5", | ||||||
| @ -42,9 +43,11 @@ | |||||||
|         "vueify-insert-css": "^1.0.0", |         "vueify-insert-css": "^1.0.0", | ||||||
|         "webpack": "^4.4.1", |         "webpack": "^4.4.1", | ||||||
|         "webpack-assets-manifest": "^3.0.1", |         "webpack-assets-manifest": "^3.0.1", | ||||||
|         "webpack-cli": "^3.0.1", |         "webpack-cli": "^3.0.2", | ||||||
|  |         "webpack-hot-client": "^4.0.2", | ||||||
|         "webpack-manifest-plugin": "^2.0.3", |         "webpack-manifest-plugin": "^2.0.3", | ||||||
|         "webpack-serve": "^1.0.2", |         "webpack-serve": "^1.0.2", | ||||||
|  |         "webpack-serve-waitpage": "^1.0.0", | ||||||
|         "webpack-shell-plugin": "^0.5.0", |         "webpack-shell-plugin": "^0.5.0", | ||||||
|         "webpack-stream": "^4.0.3" |         "webpack-stream": "^4.0.3" | ||||||
|     }, |     }, | ||||||
| @ -52,6 +55,7 @@ | |||||||
|         "build:filemanager": "./node_modules/babel-cli/bin/babel.js public/themes/pterodactyl/js/frontend/files/src --source-maps --out-file public/themes/pterodactyl/js/frontend/files/filemanager.min.js", |         "build:filemanager": "./node_modules/babel-cli/bin/babel.js public/themes/pterodactyl/js/frontend/files/src --source-maps --out-file public/themes/pterodactyl/js/frontend/files/filemanager.min.js", | ||||||
|         "watch": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress", |         "watch": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress", | ||||||
|         "build": "NODE_ENV=development ./node_modules/.bin/webpack --progress", |         "build": "NODE_ENV=development ./node_modules/.bin/webpack --progress", | ||||||
|         "build:release": "NODE_ENV=production ./node_modules/.bin/webpack" |         "build:release": "NODE_ENV=production ./node_modules/.bin/webpack", | ||||||
|  |         "serve": "NODE_ENV=development webpack-serve --config ./webpack.config.js" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								resources/assets/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								resources/assets/index.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,18 @@ | |||||||
|  | <html> | ||||||
|  | <head> | ||||||
|  |     <title>Pterodactyl Dev</title> | ||||||
|  | 
 | ||||||
|  |     <meta charset="utf-8"> | ||||||
|  |     <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||||
|  |     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | ||||||
|  | </head> | ||||||
|  | <body> | ||||||
|  | <div id="pterodactyl"> | ||||||
|  |     <router-view></router-view> | ||||||
|  |     <div class="w-full m-auto mt-0 container"> | ||||||
|  |         <p class="text-right text-grey-dark text-xs"> | ||||||
|  |         </p> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | </body> | ||||||
|  | </html> | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -8,6 +8,8 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |||||||
| const ShellPlugin = require('webpack-shell-plugin'); | const ShellPlugin = require('webpack-shell-plugin'); | ||||||
| const PurgeCssPlugin = require('purgecss-webpack-plugin'); | const PurgeCssPlugin = require('purgecss-webpack-plugin'); | ||||||
| const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||||||
|  | const HTMLWebpackPlugin = require('html-webpack-plugin'); | ||||||
|  | const WebpackServeWaitpage = require('webpack-serve-waitpage'); | ||||||
| 
 | 
 | ||||||
| // Custom PurgeCSS extractor for Tailwind that allows special characters in
 | // Custom PurgeCSS extractor for Tailwind that allows special characters in
 | ||||||
| // class names.
 | // class names.
 | ||||||
| @ -27,7 +29,7 @@ const basePlugins = [ | |||||||
|             'php artisan ziggy:generate resources/assets/scripts/helpers/ziggy.js', |             'php artisan ziggy:generate resources/assets/scripts/helpers/ziggy.js', | ||||||
|         ], |         ], | ||||||
|     }), |     }), | ||||||
|     new ExtractTextPlugin('bundle-[chunkhash].css', { |     new ExtractTextPlugin('assets/bundle.css', { | ||||||
|         allChunks: true, |         allChunks: true, | ||||||
|     }), |     }), | ||||||
|     new AssetsManifestPlugin({ |     new AssetsManifestPlugin({ | ||||||
| @ -36,6 +38,10 @@ const basePlugins = [ | |||||||
|         integrity: true, |         integrity: true, | ||||||
|         integrityHashes: ['sha384'], |         integrityHashes: ['sha384'], | ||||||
|     }), |     }), | ||||||
|  |     new HTMLWebpackPlugin({ | ||||||
|  |         template: './resources/assets/index.html', | ||||||
|  |         filename: 'index.html', | ||||||
|  |     }) | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
| const productionPlugins = [ | const productionPlugins = [ | ||||||
| @ -71,9 +77,9 @@ module.exports = { | |||||||
|     // Passing an array loads them all but only exports the last.
 |     // Passing an array loads them all but only exports the last.
 | ||||||
|     entry: ['./resources/assets/styles/main.css', './resources/assets/scripts/app.js'], |     entry: ['./resources/assets/styles/main.css', './resources/assets/scripts/app.js'], | ||||||
|     output: { |     output: { | ||||||
|         path: path.resolve(__dirname, 'public/assets'), |         path: path.resolve(__dirname, 'public'), | ||||||
|         filename: 'bundle-[chunkhash].js', |         filename: 'assets/bundle.js', | ||||||
|         publicPath: '/assets/', |         publicPath: '/', | ||||||
|         crossOriginLoading: 'anonymous', |         crossOriginLoading: 'anonymous', | ||||||
|     }, |     }, | ||||||
|     module: { |     module: { | ||||||
| @ -126,4 +132,20 @@ module.exports = { | |||||||
|         symlinks: false, |         symlinks: false, | ||||||
|     }, |     }, | ||||||
|     plugins: process.env.NODE_ENV === 'production' ? basePlugins.concat(productionPlugins) : basePlugins, |     plugins: process.env.NODE_ENV === 'production' ? basePlugins.concat(productionPlugins) : basePlugins, | ||||||
|  |     serve: { | ||||||
|  |         host: "0.0.0.0", | ||||||
|  |         content: "./public/", | ||||||
|  |         dev: { | ||||||
|  |             publicPath: "/" | ||||||
|  |         }, | ||||||
|  |         hot: { | ||||||
|  |             host: { | ||||||
|  |                 server: "0.0.0.0", | ||||||
|  |                 client: "192.168.50.2" | ||||||
|  |             } | ||||||
|  |         }, | ||||||
|  |         add (app, middleware, options) { | ||||||
|  |             app.use(WebpackServeWaitpage(options, {theme: 'dark'})); | ||||||
|  |         } | ||||||
|  |     } | ||||||
| }; | }; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jakob Schrettenbrunner
						Jakob Schrettenbrunner