Improve prod build. Add screenshot to readme.
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
# Transport
|
# Transport
|
||||||
|
|
||||||
A generative art project in progress.
|
Work-in-progress procedurally generated train network simulation written in
|
||||||
|
Typescript with PixiJs.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|||||||
BIN
img/screenshot.png
Normal file
BIN
img/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 307 KiB |
@@ -38,6 +38,7 @@
|
|||||||
"tslint": "^5.9.1",
|
"tslint": "^5.9.1",
|
||||||
"tslint-config-airbnb": "^5.8.0",
|
"tslint-config-airbnb": "^5.8.0",
|
||||||
"typescript": "^2.8.1",
|
"typescript": "^2.8.1",
|
||||||
|
"uglifyjs-webpack-plugin": "^1.2.4",
|
||||||
"webpack": "^4.4.1",
|
"webpack": "^4.4.1",
|
||||||
"webpack-cli": "^2.0.13",
|
"webpack-cli": "^2.0.13",
|
||||||
"webpack-dev-server": "^3.1.1"
|
"webpack-dev-server": "^3.1.1"
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||||
|
|
||||||
const env = process.env.NODE_ENV;
|
const env = process.env.NODE_ENV;
|
||||||
|
|
||||||
|
const prodPlugins = env === 'production' ? [
|
||||||
|
new UglifyJsPlugin({
|
||||||
|
sourceMap: true,
|
||||||
|
}),
|
||||||
|
] : [];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/transport.ts',
|
entry: './src/transport.ts',
|
||||||
output: {
|
output: {
|
||||||
filename: 'transport.js',
|
filename: env === 'production' ? '[name].min.js' : '[name].js',
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
},
|
},
|
||||||
mode: env === 'production' ? 'production' : 'development',
|
mode: env === 'production' ? 'production' : 'development',
|
||||||
@@ -61,8 +68,20 @@ module.exports = {
|
|||||||
disable: env === 'development',
|
disable: env === 'development',
|
||||||
filename: '[name].css',
|
filename: '[name].css',
|
||||||
}),
|
}),
|
||||||
|
...prodPlugins,
|
||||||
],
|
],
|
||||||
devtool: 'cheap-module-eval-source-map',
|
optimization: {
|
||||||
|
splitChunks: {
|
||||||
|
cacheGroups: {
|
||||||
|
commons: {
|
||||||
|
test: /[\\/]node_modules[\\/]/,
|
||||||
|
name: 'vendors',
|
||||||
|
chunks: 'all',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
devtool: env === 'production' ? 'source-map' : 'cheap-module-eval-source-map',
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: path.join(__dirname, 'dist'),
|
contentBase: path.join(__dirname, 'dist'),
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
|||||||
Reference in New Issue
Block a user