-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from gregoranders/development
Merge with Development
- Loading branch information
Showing
14 changed files
with
173 additions
and
160 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Release CI | |
on: | ||
release: | ||
types: | ||
- created | ||
- edited | ||
|
||
jobs: | ||
build: | ||
|
This file contains 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 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 |
---|---|---|
@@ -1,140 +1,10 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
'use strict'; | ||
const path = require('path'); | ||
const CaseSensitivePlugin = require('case-sensitive-paths-webpack-plugin'); | ||
const CleanPlugin = require('clean-webpack-plugin').CleanWebpackPlugin; | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
const webpack = require('webpack'); | ||
const plugins = [ | ||
new CaseSensitivePlugin(), | ||
new CleanPlugin(), | ||
new HtmlWebpackPlugin({ | ||
filename: 'index.html', | ||
title: 'TypeScript React Redux Webpack Demo', | ||
template: path.join('./public', 'webpack.html'), | ||
}), | ||
new MiniCssExtractPlugin({ | ||
filename: 'css/[name].css', | ||
chunkFilename: 'css/[name].css', | ||
}), | ||
new webpack.ProgressPlugin(), | ||
]; | ||
const cssLoaders = [ | ||
{ | ||
loader: 'css-loader', | ||
}, | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sassOptions: { includePaths: ['node_modules'] }, | ||
}, | ||
}, | ||
]; | ||
const sassLoaders = cssLoaders.concat([ | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sassOptions: { includePaths: ['node_modules'] }, | ||
}, | ||
}, | ||
]); | ||
const config = require('../webpack.config.js'); | ||
|
||
module.exports = { | ||
mode: 'production', | ||
entry: { | ||
index: path.resolve(path.join('src', 'script', 'index.tsx')), | ||
styles: path.resolve(path.join('src', 'style', 'styles.scss')), | ||
}, | ||
output: { | ||
path: path.resolve('./dist'), | ||
filename: 'js/[name].bundle.js', | ||
}, | ||
optimization: { | ||
minimize: false, | ||
runtimeChunk: { | ||
name: 'runtime', | ||
}, | ||
splitChunks: { | ||
cacheGroups: { | ||
commons: { | ||
chunks: 'initial', | ||
minChunks: 2, | ||
maxInitialRequests: 5, | ||
minSize: 0, | ||
}, | ||
vendor: { | ||
test: /node_modules/, | ||
chunks: 'initial', | ||
name: 'vendor', | ||
priority: 10, | ||
enforce: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
performance: { | ||
maxEntrypointSize: 2000000, | ||
maxAssetSize: 2000000, | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.tsx', '.scss', '.js'], | ||
alias: { | ||
'@models': path.resolve('src/script/models'), | ||
'@atoms': path.resolve('src/script/components/atoms'), | ||
'@organisms': path.resolve('src/script/components/organisms'), | ||
'@molecules': path.resolve('src/script/components/molecules'), | ||
'@pages': path.resolve('src/script/components/pages'), | ||
'@components': path.resolve('src/script/components'), | ||
'@app': path.resolve('src/script'), | ||
'./fonts': 'node_modules/@fortawesome/fontawesome-free/webfonts', | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: 'ts-loader', | ||
}, | ||
{ | ||
test: /\.s[a|c]ss$/, | ||
use: [MiniCssExtractPlugin.loader].concat(sassLoaders), | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [MiniCssExtractPlugin.loader].concat(cssLoaders), | ||
}, | ||
{ | ||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, | ||
loader: 'url-loader', | ||
options: { | ||
limit: 10000, | ||
name: 'images/[name].[ext]', | ||
}, | ||
}, | ||
{ | ||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, | ||
loader: 'url-loader', | ||
options: { | ||
limit: 10000, | ||
name: 'media/[name].[ext]', | ||
}, | ||
}, | ||
{ | ||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, | ||
loader: 'url-loader', | ||
options: { | ||
limit: 10000, | ||
name: 'fonts/[name].[ext]', | ||
}, | ||
}, | ||
], | ||
}, | ||
devServer: { | ||
historyApiFallback: true, | ||
host: '0.0.0.0', | ||
port: 7683, | ||
hot: false, | ||
inline: false, | ||
}, | ||
plugins: plugins, | ||
}; | ||
config.devServer.hot = false; | ||
config.devServer.inline = false; | ||
config.devServer.stats = 'none'; | ||
config.stats = 'none'; | ||
|
||
module.exports = config; |
This file contains 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,4 @@ | ||
import { getPort } from 'portfinder-sync'; | ||
import { baseport } from './package.json'; | ||
|
||
console.log(getPort(baseport)); |
This file contains 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 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 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,40 @@ | ||
// import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
import * as express from 'express'; | ||
import * as https from 'http'; | ||
import * as compression from 'compression'; | ||
|
||
import { baseport } from './package.json'; | ||
|
||
// import { api } from './controller'; | ||
const hostname = 'localhost'; | ||
const staticPath: string = path.join(__dirname, 'public'); | ||
|
||
const application = express(); | ||
|
||
application.set('port', process.env.NODE_PORT || baseport); | ||
application.use(compression()); | ||
application.use('/ts-react-playground', express.static(staticPath)); | ||
|
||
// application.get('/api/*', api); | ||
|
||
application.use((req: express.Request, res: express.Response) => { | ||
console.log(req.url); | ||
res.sendFile(path.join(staticPath, 'index.html')); | ||
}); | ||
|
||
const httpOptions = { | ||
// key: fs.readFileSync(path.resolve(__dirname, 'certs', 'key.pem')), | ||
// cert: fs.readFileSync(path.resolve(__dirname, 'certs', 'cert.pem')), | ||
}; | ||
|
||
https.createServer(httpOptions, application).listen(application.get('port'), () => { | ||
console.log( | ||
` App is running at http://${hostname}:%d in %s mode (%s) (%s)`, | ||
application.get('port'), | ||
application.get('env'), | ||
staticPath, | ||
); | ||
console.log(' Press CTRL-C to stop\n'); | ||
}); |
This file contains 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 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 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
Oops, something went wrong.