Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
Fixed pathes
  • Loading branch information
alxarno committed Jun 17, 2019
2 parents abbfd6d + 775d00d commit 1b30036
Show file tree
Hide file tree
Showing 39 changed files with 163 additions and 53 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ dist/bundle.js
*.lock
*.log
.vscode/
stats.json
stats.json
*.zip
*.tar.gz
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
82 changes: 41 additions & 41 deletions dist/assets/menu-button.svg → assets/menu-button.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./node_modules/.bin/webpack --config webpack.prod.js
8 changes: 6 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<title>Swap Messenger</title>
<link rel="shortcut icon" href="/favicon.png">
<link href="/fonts/Roboto-Regular.ttf" rel="stylesheet">
<!-- <link href="/fonts/Roboto-Regular.ttf" rel="stylesheet"> -->
<style>
#root{
width: 100vw;
Expand Down Expand Up @@ -62,6 +62,10 @@
-webkit-transform: scale(1.0);
}
}
@font-face{
font-family: Roboto;
src: url('/fonts/Roboto-Regular.ttf')
}
</style>
</head>
<body>
Expand All @@ -74,7 +78,7 @@
</div>
</div>
</div>
<script src="bundle.js"></script>
<script src="/bundle.js"></script>
</body>

</html>
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import WebSocketAPI from "./hard/web-socket";
import { IWebSocket } from "./interfaces/web-socket";
import { ILocalStorage } from "./interfaces/local-storage";
import LocalStorage from "./hard/local-storage";
// import { GenerateKeys, Test } from "./hard/crypto";
import config from "./config";

const URL = "https://192.168.1.38:3030";
let URL = window.location.host;
// PODUCTION defined in webpack.config/prod.js file, its variable change in compile time
if (!PRODUCTION) {
URL = "https://192.168.1.38:3030";
}
const LOGS = true;
const IMITATION = false;

Expand Down
13 changes: 6 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const webpack = require('webpack');
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin");

function getEntrySources(sources) {
Expand All @@ -13,8 +13,6 @@ function getEntrySources(sources) {
return sources;
}



module.exports = {
entry: getEntrySources(['./src/index.ts']),
output: {
Expand All @@ -27,7 +25,7 @@ module.exports = {
extensions: ['.js', '.json', '.ts', '.tsx'],
alias:{
src: path.resolve('./src'),
assets: path.resolve('./dist/assets')
assets: path.resolve('./assets')
}
},
module: {
Expand Down Expand Up @@ -95,10 +93,11 @@ module.exports = {
]
},
plugins: [
// new TsconfigPathsPlugin({ configFile: "./tsconfig.json"}),
new webpack.HotModuleReplacementPlugin(),
new ForkTsCheckerWebpackPlugin()

new webpack.DefinePlugin({
'PRODUCTION': false,
}),
new ForkTsCheckerWebpackPlugin(),
],
devServer: {
port: 8080,
Expand Down
101 changes: 101 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
const path = require('path');
const webpack = require('webpack');
var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
// const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
// const LoaderOptionsPlugin = require("webpack/lib/LoaderOptionsPlugin");

function getEntrySources(sources) {
if (process.env.NODE_ENV !== 'production') {
sources.push('webpack-dev-server/client?http://localhost:8080');
sources.push('webpack/hot/only-dev-server');
}

return sources;
}

module.exports = {
entry: getEntrySources(['./src/index.ts']),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',

},
cache:true,
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx'],
alias:{
src: path.resolve('./src'),
assets: path.resolve('./assets')
}
},
module: {
rules:[
{
enforce: 'pre',
test: /\.tsx?$/,
loader: 'tslint-loader',
exclude: /(node_modules)/,
},
{
test: /\.(ts|tsx)$/,
// include: path.resolve(__dirname, 'src'),
use:[
{
loader: "ts-loader",
options: {
transpileOnly: true
}
}
]
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
{
test: /\.scss$/,
use: [
"style-loader",
"css-loader",
{
loader: "sass-loader",
options:{
data: `@import "variables";`,
includePaths:[
path.resolve(__dirname, "src")
]
}
}
]
},{
test: /\.(png|jpe?g)$/,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
bypassOnDebug:true,
mozjpeg: {
progressive: true,
quality: 65
},
pngquant: {
quality: '65-90',
speed: 4
},
}
},
]
},{
test: /\.otf$/,
loader: 'url-loader?limit=100000'
}
]
},
plugins: [
new webpack.DefinePlugin({
'PRODUCTION': true,
}),
new ForkTsCheckerWebpackPlugin(),
],
};

0 comments on commit 1b30036

Please sign in to comment.