-
Notifications
You must be signed in to change notification settings - Fork 17
Separate webpack workflow into development and production for the library and typescript example packages #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dan-tw
merged 27 commits into
ScalablePixelStreaming:v1.0.0
from
adrianZahra:newwebpackfiles
Apr 4, 2023
Merged
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ad0c309
added new webpack files
adrianZahra 291b7e0
removed old webpack config file
adrianZahra 790515e
added base for the webpack common file
adrianZahra f41c888
added base content to the dev and prod webpack files
adrianZahra 1af870e
moddified package.json for the new build configs
adrianZahra 7baa785
removed the old webpack common file from the example
adrianZahra 00f006e
added webpack dev and prod
adrianZahra 54a9a6d
updated the package.json for the typescript example
adrianZahra bfae2e4
updated the nade of the library variable in the example index.ts
adrianZahra 8a487a8
added symlink to package.json in the example
adrianZahra 447ac01
updated main location and updated npm serve command
adrianZahra 065c7fc
updated webpack config to webpack common to make use of the dev and p…
adrianZahra 7ff11b7
updated the websocket url env to make use of process
adrianZahra 3492e0c
upgraded the tag workflow to use the production builder command
adrianZahra a27b2b9
updated the tag and pull request workflows to use the new build commands
adrianZahra 994367b
fixed spelling mistake in the pull request workflow
adrianZahra 0e6eff2
updated comments in accordance to comment from luke post merge
adrianZahra ded28fd
added env template for example and updated git ignore to accomadate this
adrianZahra 86ddce5
updated the pull request test to test all aspects of the library and …
adrianZahra 86695b0
added serve for dev and prod
adrianZahra 0cbcf88
updated the index file to just import the required types
adrianZahra 57089f6
updated the pull request test to test all aspects of the library and …
adrianZahra da665f8
moved env file and renamed to example also included dontenv plugin to…
adrianZahra ba8f90a
removed old template
adrianZahra 4bb88df
updated index file to make use of the env if it is not empty
adrianZahra c8858a6
updated if statement to single queals
adrianZahra 7d2f512
updated the git ignore file for the env.example
adrianZahra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| WEBSOCKET_URL=ws://example.com/your/ws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| const path = require('path'); | ||
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
| const webpack = require('webpack'); | ||
|
|
||
| module.exports = { | ||
| entry: { | ||
| index: './src/index.ts', | ||
| }, | ||
| plugins: [ | ||
| new webpack.DefinePlugin({ | ||
| WEBSOCKET_URL: JSON.stringify((process.env.WEBSOCKET_URL !== undefined) ? process.env.WEBSOCKET_URL : '') | ||
adrianZahra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }), | ||
| new HtmlWebpackPlugin({ | ||
| title: 'Scalable Pixel Streaming Frontend', | ||
| template: './src/index.html', | ||
| filename: 'index.html' | ||
| }), | ||
| ], | ||
| module: { | ||
| rules: [ | ||
| { | ||
| test: /\.tsx?$/, | ||
| loader: 'ts-loader', | ||
| exclude: [ | ||
| /node_modules/, | ||
| ], | ||
| }, | ||
| { | ||
| test: /\.html$/i, | ||
| use: 'html-loader' | ||
| }, | ||
| { | ||
| test: /\.css$/, | ||
| type: 'asset/resource', | ||
| generator: { | ||
| filename: '[name][ext]' | ||
| } | ||
| }, | ||
| { | ||
| test: /\.(png|svg)$/i, | ||
| type: 'asset/resource', | ||
| generator: { | ||
| filename: 'images/[name][ext]' | ||
| } | ||
| }, | ||
| ], | ||
| }, | ||
| resolve: { | ||
| extensions: ['.tsx', '.ts', '.js', '.svg'], | ||
| }, | ||
| output: { | ||
| filename: '[name].js', | ||
| library: 'spstypescriptexample', | ||
| libraryTarget: 'umd', | ||
| path: path.resolve(__dirname, 'dist'), | ||
| clean: true, | ||
| globalObject: 'this', | ||
| hashFunction: 'xxhash64' | ||
| }, | ||
| experiments: { | ||
| futureDefaults: true | ||
| }, | ||
| optimization: { | ||
| minimize: false | ||
| }, | ||
| devServer: { | ||
| static: { | ||
| directory: path.join(__dirname, 'dist'), | ||
| }, | ||
| }, | ||
| }; | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| const { merge } = require('webpack-merge'); | ||
| const common = require('./webpack.common.js'); | ||
| const path = require('path'); | ||
|
|
||
| module.exports = merge(common, { | ||
| mode: 'development', | ||
| devtool: 'inline-source-map', | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| const { merge } = require('webpack-merge'); | ||
| const common = require('./webpack.common.js'); | ||
|
|
||
| module.exports = merge(common, { | ||
| mode: 'production', | ||
| optimization: { | ||
| usedExports: true, | ||
| minimize: true | ||
| }, | ||
| stats: 'errors-only', | ||
| performance: { | ||
| hints: false | ||
| } | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| const package = require('./package.json'); | ||
| const path = require('path'); | ||
| const webpack = require('webpack'); | ||
|
|
||
| module.exports = { | ||
| entry: { | ||
| index: './src/index.ts' | ||
| }, | ||
| module: { | ||
| rules: [ | ||
| { | ||
| test: /\.tsx?$/, | ||
| loader: 'ts-loader', | ||
| exclude: [/node_modules/] | ||
| } | ||
| ] | ||
| }, | ||
| resolve: { | ||
| extensions: ['.tsx', '.ts', '.js'] | ||
| }, | ||
| plugins: [], | ||
| output: { | ||
| path: path.resolve(__dirname, 'dist'), | ||
| globalObject: 'this' | ||
| } | ||
| }; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.